summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_codec.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-27 16:17:18 +0100
committerTakashi Iwai <tiwai@suse.de>2015-03-03 11:25:17 +0100
commitf4de8fe6cffb449a779dff61f071bd1af9e18e0f (patch)
tree3afbb7a3c79e6b995a67d03e33e70c3a622dc008 /sound/pci/hda/hda_codec.c
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/hda_codec.c')
-rw-r--r--sound/pci/hda/hda_codec.c16
1 files changed, 4 insertions, 12 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,
*busp = NULL;
bus = kzalloc(sizeof(*bus), GFP_KERNEL);
- if (bus == NULL) {
- dev_err(card->dev, "can't allocate struct hda_bus\n");
+ if (!bus)
return -ENOMEM;
- }
bus->card = card;
mutex_init(&bus->cmd_mutex);
@@ -1223,10 +1221,8 @@ int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
}
codec = kzalloc(sizeof(*codec), GFP_KERNEL);
- if (codec == NULL) {
- dev_err(card->dev, "can't allocate struct hda_codec\n");
+ if (!codec)
return -ENOMEM;
- }
dev = hda_codec_dev(codec);
device_initialize(dev);
@@ -1307,10 +1303,8 @@ int snd_hda_codec_new(struct hda_bus *bus, struct snd_card *card,
fg = codec->afg ? codec->afg : codec->mfg;
err = read_widget_caps(codec, fg);
- if (err < 0) {
- dev_err(card->dev, "cannot malloc\n");
+ if (err < 0)
goto error;
- }
err = read_pin_defaults(codec);
if (err < 0)
goto error;
@@ -1371,10 +1365,8 @@ int snd_hda_codec_update_widgets(struct hda_codec *codec)
kfree(codec->wcaps);
fg = codec->afg ? codec->afg : codec->mfg;
err = read_widget_caps(codec, fg);
- if (err < 0) {
- codec_err(codec, "cannot malloc\n");
+ if (err < 0)
return err;
- }
snd_array_free(&codec->init_pins);
err = read_pin_defaults(codec);