ALSA: via82xx - ignore buffer preallocation errors
authorTakashi Iwai <tiwai@suse.de>
Thu, 21 Aug 2008 12:17:38 +0000 (14:17 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 25 Aug 2008 07:57:41 +0000 (09:57 +0200)
The errors at buffer preallocations aren't fatal and safe to ignore.
The buffer will be allocated dynamically when opened.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/pci/via82xx.c

index 8766848..57e33d7 100644 (file)
@@ -1401,10 +1401,9 @@ static int __devinit snd_via8233_pcm_new(struct via82xx *chip)
        /* capture */
        init_viadev(chip, chip->capture_devno, VIA_REG_CAPTURE_8233_STATUS, 6, 1);
 
-       if ((err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
-                                                        snd_dma_pci_data(chip->pci),
-                                                        64*1024, 128*1024)) < 0)
-               return err;
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
+                                             snd_dma_pci_data(chip->pci),
+                                             64*1024, 128*1024);
 
        /* PCM #1:  multi-channel playback and 2nd capture */
        err = snd_pcm_new(chip->card, chip->card->shortname, 1, 1, 1, &pcm);
@@ -1420,11 +1419,9 @@ static int __devinit snd_via8233_pcm_new(struct via82xx *chip)
        /* set up capture */
        init_viadev(chip, chip->capture_devno + 1, VIA_REG_CAPTURE_8233_STATUS + 0x10, 7, 1);
 
-       if ((err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
-                                                        snd_dma_pci_data(chip->pci),
-                                                        64*1024, 128*1024)) < 0)
-               return err;
-
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
+                                             snd_dma_pci_data(chip->pci),
+                                             64*1024, 128*1024);
        return 0;
 }
 
@@ -1456,10 +1453,9 @@ static int __devinit snd_via8233a_pcm_new(struct via82xx *chip)
        /* capture */
        init_viadev(chip, chip->capture_devno, VIA_REG_CAPTURE_8233_STATUS, 6, 1);
 
-       if ((err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
-                                                        snd_dma_pci_data(chip->pci),
-                                                        64*1024, 128*1024)) < 0)
-               return err;
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
+                                             snd_dma_pci_data(chip->pci),
+                                             64*1024, 128*1024);
 
        /* SPDIF supported? */
        if (! ac97_can_spdif(chip->ac97))
@@ -1476,11 +1472,9 @@ static int __devinit snd_via8233a_pcm_new(struct via82xx *chip)
        /* set up playback */
        init_viadev(chip, chip->playback_devno, 0x30, 3, 0);
 
-       if ((err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
-                                                        snd_dma_pci_data(chip->pci),
-                                                        64*1024, 128*1024)) < 0)
-               return err;
-
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
+                                             snd_dma_pci_data(chip->pci),
+                                             64*1024, 128*1024)
        return 0;
 }
 
@@ -1508,11 +1502,9 @@ static int __devinit snd_via686_pcm_new(struct via82xx *chip)
        init_viadev(chip, 0, VIA_REG_PLAYBACK_STATUS, 0, 0);
        init_viadev(chip, 1, VIA_REG_CAPTURE_STATUS, 0, 1);
 
-       if ((err = snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
-                                                        snd_dma_pci_data(chip->pci),
-                                                        64*1024, 128*1024)) < 0)
-               return err;
-
+       snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
+                                             snd_dma_pci_data(chip->pci),
+                                             64*1024, 128*1024);
        return 0;
 }