aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-27 10:17:18 -0500
committerTakashi Iwai <tiwai@suse.de>2015-03-03 05:25:17 -0500
commitf4de8fe6cffb449a779dff61f071bd1af9e18e0f (patch)
tree3afbb7a3c79e6b995a67d03e33e70c3a622dc008 /sound/pci/hda
parent6efdd8513f182492c21fb7238592d4539d5c751a (diff)
ALSA: hda - Remove superfluous memory allocation error messages
The memory allocators should have already given the kernel warning messages, thus we don't have to annoy again. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_codec.c16
-rw-r--r--sound/pci/hda/hda_controller.c18
-rw-r--r--sound/pci/hda/hda_intel.c5
3 files changed, 9 insertions, 30 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 0533c862b539..262c41a8f96e 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -776,10 +776,8 @@ int snd_hda_bus_new(struct snd_card *card,
776 *busp = NULL; 776 *busp = NULL;
777 777
778 bus = kzalloc(sizeof(*bus), GFP_KERNEL); 778 bus = kzalloc(sizeof(*bus), GFP_KERNEL);
779 if (bus == NULL) { 779 if (!bus)
780 dev_err(card->dev, "can't allocate struct hda_bus\n");
781 return -ENOMEM; 780 return -ENOMEM;
782 }
783 781
784 bus->card = card; 782 bus->card = card;
785 mutex_init(&bus->cmd_mutex); 783 mutex_init(&bus->cmd_mutex);
@@ -1223,10 +1221,8 @@ int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
1223 } 1221 }
1224 1222
1225 codec = kzalloc(sizeof(*codec), GFP_KERNEL); 1223 codec = kzalloc(sizeof(*codec), GFP_KERNEL);
1226 if (codec == NULL) { 1224 if (!codec)
1227 dev_err(card->dev, "can't allocate struct hda_codec\n");
1228 return -ENOMEM; 1225 return -ENOMEM;
1229 }
1230 1226
1231 dev = hda_codec_dev(codec); 1227 dev = hda_codec_dev(codec);
1232 device_initialize(dev); 1228 device_initialize(dev);
@@ -1307,10 +1303,8 @@ int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
1307 1303
1308 fg = codec->afg ? codec->afg : codec->mfg; 1304 fg = codec->afg ? codec->afg : codec->mfg;
1309 err = read_widget_caps(codec, fg); 1305 err = read_widget_caps(codec, fg);
1310 if (err < 0) { 1306 if (err < 0)
1311 dev_err(card->dev, "cannot malloc\n");
1312 goto error; 1307 goto error;
1313 }
1314 err = read_pin_defaults(codec); 1308 err = read_pin_defaults(codec);
1315 if (err < 0) 1309 if (err < 0)
1316 goto error; 1310 goto error;
@@ -1371,10 +1365,8 @@ int snd_hda_codec_update_widgets(struct hda_codec *codec)
1371 kfree(codec->wcaps); 1365 kfree(codec->wcaps);
1372 fg = codec->afg ? codec->afg : codec->mfg; 1366 fg = codec->afg ? codec->afg : codec->mfg;
1373 err = read_widget_caps(codec, fg); 1367 err = read_widget_caps(codec, fg);
1374 if (err < 0) { 1368 if (err < 0)
1375 codec_err(codec, "cannot malloc\n");
1376 return err; 1369 return err;
1377 }
1378 1370
1379 snd_array_free(&codec->init_pins); 1371 snd_array_free(&codec->init_pins);
1380 err = read_pin_defaults(codec); 1372 err = read_pin_defaults(codec);
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
index f50863a5159d..be02bca6f7e6 100644
--- a/sound/pci/hda/hda_controller.c
+++ b/sound/pci/hda/hda_controller.c
@@ -974,14 +974,9 @@ static int azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
974 */ 974 */
975static int azx_alloc_cmd_io(struct azx *chip) 975static int azx_alloc_cmd_io(struct azx *chip)
976{ 976{
977 int err;
978
979 /* single page (at least 4096 bytes) must suffice for both ringbuffes */ 977 /* single page (at least 4096 bytes) must suffice for both ringbuffes */
980 err = chip->ops->dma_alloc_pages(chip, SNDRV_DMA_TYPE_DEV, 978 return chip->ops->dma_alloc_pages(chip, SNDRV_DMA_TYPE_DEV,
981 PAGE_SIZE, &chip->rb); 979 PAGE_SIZE, &chip->rb);
982 if (err < 0)
983 dev_err(chip->card->dev, "cannot allocate CORB/RIRB\n");
984 return err;
985} 980}
986EXPORT_SYMBOL_GPL(azx_alloc_cmd_io); 981EXPORT_SYMBOL_GPL(azx_alloc_cmd_io);
987 982
@@ -1472,7 +1467,6 @@ static void azx_load_dsp_cleanup(struct hda_bus *bus,
1472int azx_alloc_stream_pages(struct azx *chip) 1467int azx_alloc_stream_pages(struct azx *chip)
1473{ 1468{
1474 int i, err; 1469 int i, err;
1475 struct snd_card *card = chip->card;
1476 1470
1477 for (i = 0; i < chip->num_streams; i++) { 1471 for (i = 0; i < chip->num_streams; i++) {
1478 dsp_lock_init(&chip->azx_dev[i]); 1472 dsp_lock_init(&chip->azx_dev[i]);
@@ -1480,18 +1474,14 @@ int azx_alloc_stream_pages(struct azx *chip)
1480 err = chip->ops->dma_alloc_pages(chip, SNDRV_DMA_TYPE_DEV, 1474 err = chip->ops->dma_alloc_pages(chip, SNDRV_DMA_TYPE_DEV,
1481 BDL_SIZE, 1475 BDL_SIZE,
1482 &chip->azx_dev[i].bdl); 1476 &chip->azx_dev[i].bdl);
1483 if (err < 0) { 1477 if (err < 0)
1484 dev_err(card->dev, "cannot allocate BDL\n");
1485 return -ENOMEM; 1478 return -ENOMEM;
1486 }
1487 } 1479 }
1488 /* allocate memory for the position buffer */ 1480 /* allocate memory for the position buffer */
1489 err = chip->ops->dma_alloc_pages(chip, SNDRV_DMA_TYPE_DEV, 1481 err = chip->ops->dma_alloc_pages(chip, SNDRV_DMA_TYPE_DEV,
1490 chip->num_streams * 8, &chip->posbuf); 1482 chip->num_streams * 8, &chip->posbuf);
1491 if (err < 0) { 1483 if (err < 0)
1492 dev_err(card->dev, "cannot allocate posbuf\n");
1493 return -ENOMEM; 1484 return -ENOMEM;
1494 }
1495 1485
1496 /* allocate CORB/RIRB */ 1486 /* allocate CORB/RIRB */
1497 err = azx_alloc_cmd_io(chip); 1487 err = azx_alloc_cmd_io(chip);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e75e8137e296..f7fb1b51d446 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1383,7 +1383,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
1383 1383
1384 hda = kzalloc(sizeof(*hda), GFP_KERNEL); 1384 hda = kzalloc(sizeof(*hda), GFP_KERNEL);
1385 if (!hda) { 1385 if (!hda) {
1386 dev_err(card->dev, "Cannot allocate hda\n");
1387 pci_disable_device(pci); 1386 pci_disable_device(pci);
1388 return -ENOMEM; 1387 return -ENOMEM;
1389 } 1388 }
@@ -1564,10 +1563,8 @@ static int azx_first_init(struct azx *chip)
1564 chip->num_streams = chip->playback_streams + chip->capture_streams; 1563 chip->num_streams = chip->playback_streams + chip->capture_streams;
1565 chip->azx_dev = kcalloc(chip->num_streams, sizeof(*chip->azx_dev), 1564 chip->azx_dev = kcalloc(chip->num_streams, sizeof(*chip->azx_dev),
1566 GFP_KERNEL); 1565 GFP_KERNEL);
1567 if (!chip->azx_dev) { 1566 if (!chip->azx_dev)
1568 dev_err(card->dev, "cannot malloc azx_dev\n");
1569 return -ENOMEM; 1567 return -ENOMEM;
1570 }
1571 1568
1572 err = azx_alloc_stream_pages(chip); 1569 err = azx_alloc_stream_pages(chip);
1573 if (err < 0) 1570 if (err < 0)