media: Drop superfluous PCM preallocation error checks
authorTakashi Iwai <tiwai@suse.de>
Wed, 6 Feb 2019 11:01:48 +0000 (12:01 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 6 Feb 2019 17:37:29 +0000 (18:37 +0100)
snd_pcm_lib_preallocate_pages() and co always succeed, so the error
check is simply redundant.  Drop it.

Acked-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
drivers/media/pci/solo6x10/solo6x10-g723.c
drivers/media/pci/tw686x/tw686x-audio.c

index 2cc05a9d57ac17e854533c1a8d68e5c6e5de1e04..a16242a9206fb6a99f474b11bb194d17e94f4451 100644 (file)
@@ -360,13 +360,11 @@ static int solo_snd_pcm_init(struct solo_dev *solo_dev)
             ss; ss = ss->next, i++)
                sprintf(ss->name, "Camera #%d Audio", i);
 
-       ret = snd_pcm_lib_preallocate_pages_for_all(pcm,
+       snd_pcm_lib_preallocate_pages_for_all(pcm,
                                        SNDRV_DMA_TYPE_CONTINUOUS,
                                        snd_dma_continuous_data(GFP_KERNEL),
                                        G723_PERIOD_BYTES * PERIODS,
                                        G723_PERIOD_BYTES * PERIODS);
-       if (ret < 0)
-               return ret;
 
        solo_dev->snd_pcm = pcm;
 
index a28329698e205a86720b519b8e92612abe9e99a3..fb0e7573b5aea3929a047214d61a1dadd02048d9 100644 (file)
@@ -301,11 +301,12 @@ static int tw686x_snd_pcm_init(struct tw686x_dev *dev)
             ss; ss = ss->next, i++)
                snprintf(ss->name, sizeof(ss->name), "vch%u audio", i);
 
-       return snd_pcm_lib_preallocate_pages_for_all(pcm,
+       snd_pcm_lib_preallocate_pages_for_all(pcm,
                                SNDRV_DMA_TYPE_DEV,
                                snd_dma_pci_data(dev->pci_dev),
                                TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX,
                                TW686X_AUDIO_PAGE_MAX * AUDIO_DMA_SIZE_MAX);
+       return 0;
 }
 
 static void tw686x_audio_dma_free(struct tw686x_dev *dev,