diff options
author | Liam Girdwood <liam.girdwood@wolfsonmicro.com> | 2006-10-16 15:19:48 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:00:59 -0500 |
commit | 12e74f7d430655f541b85018ea62bcd669094bd7 (patch) | |
tree | d97b97de278201a6d6b8644b6a7d2f1e7d75bcee | |
parent | cbcc2c4c07bd34586c7fd8d7513d3a397d39ce3c (diff) |
[ALSA] ASoC - Fix build warnings in soc-core.c
This patch fixes some build warnings in soc-core.c
Changes:-
o Check the return value of soc_ac97_dev_register()
o Check return value of calls to device_create_file()
Signed-off-by: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | sound/soc/soc-core.c | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 8d6ff047d7a0..2ce0c8251dc3 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1438,12 +1438,18 @@ int snd_soc_register_card(struct snd_soc_device *socdev) | |||
1438 | { | 1438 | { |
1439 | struct snd_soc_codec *codec = socdev->codec; | 1439 | struct snd_soc_codec *codec = socdev->codec; |
1440 | struct snd_soc_machine *machine = socdev->machine; | 1440 | struct snd_soc_machine *machine = socdev->machine; |
1441 | int ret = 0, i, ac97 = 0; | 1441 | int ret = 0, i, ac97 = 0, err = 0; |
1442 | 1442 | ||
1443 | mutex_lock(&codec->mutex); | 1443 | mutex_lock(&codec->mutex); |
1444 | for(i = 0; i < machine->num_links; i++) { | 1444 | for(i = 0; i < machine->num_links; i++) { |
1445 | if (socdev->machine->dai_link[i].init) | 1445 | if (socdev->machine->dai_link[i].init) { |
1446 | socdev->machine->dai_link[i].init(codec); | 1446 | err = socdev->machine->dai_link[i].init(codec); |
1447 | if (err < 0) { | ||
1448 | printk(KERN_ERR "asoc: failed to init %s\n", | ||
1449 | socdev->machine->dai_link[i].stream_name); | ||
1450 | continue; | ||
1451 | } | ||
1452 | } | ||
1447 | if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97) | 1453 | if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97) |
1448 | ac97 = 1; | 1454 | ac97 = 1; |
1449 | } | 1455 | } |
@@ -1456,17 +1462,28 @@ int snd_soc_register_card(struct snd_soc_device *socdev) | |||
1456 | if (ret < 0) { | 1462 | if (ret < 0) { |
1457 | printk(KERN_ERR "asoc: failed to register soundcard for codec %s\n", | 1463 | printk(KERN_ERR "asoc: failed to register soundcard for codec %s\n", |
1458 | codec->name); | 1464 | codec->name); |
1459 | mutex_unlock(&codec->mutex); | 1465 | goto out; |
1460 | return ret; | ||
1461 | } | 1466 | } |
1462 | 1467 | ||
1463 | #ifdef CONFIG_SND_SOC_AC97_BUS | 1468 | #ifdef CONFIG_SND_SOC_AC97_BUS |
1464 | if (ac97) | 1469 | if (ac97) { |
1465 | soc_ac97_dev_register(codec); | 1470 | ret = soc_ac97_dev_register(codec); |
1471 | if (ret < 0) { | ||
1472 | printk(KERN_ERR "asoc: AC97 device register failed\n"); | ||
1473 | snd_card_free(codec->card); | ||
1474 | goto out; | ||
1475 | } | ||
1476 | } | ||
1466 | #endif | 1477 | #endif |
1467 | 1478 | ||
1468 | snd_soc_dapm_sys_add(socdev->dev); | 1479 | err = snd_soc_dapm_sys_add(socdev->dev); |
1469 | device_create_file(socdev->dev, &dev_attr_codec_reg); | 1480 | if (err < 0) |
1481 | printk(KERN_WARNING "asoc: failed to add dapm sysfs entries\n"); | ||
1482 | |||
1483 | err = device_create_file(socdev->dev, &dev_attr_codec_reg); | ||
1484 | if (err < 0) | ||
1485 | printk(KERN_WARNING "asoc: failed to add codec sysfs entries\n"); | ||
1486 | out: | ||
1470 | mutex_unlock(&codec->mutex); | 1487 | mutex_unlock(&codec->mutex); |
1471 | return ret; | 1488 | return ret; |
1472 | } | 1489 | } |