diff options
author | Fabio Estevam <festevam@gmail.com> | 2012-02-17 16:40:38 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-02-17 16:51:01 -0500 |
commit | 0837fc624391378ea25c9f811c90d49b8808ba1a (patch) | |
tree | 88ab80dac57d9f5cd7ea052c6f7206ecb9a10220 /sound | |
parent | d5a7f23f9c8be29833ef4d805976b6906c25c658 (diff) |
ASoC: soc-core: Show the returned values on error messages
Showing the returned values on error messages is useful information.
While at it, use pr_err/pr_warn whenever possible.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-core.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 32ca75e20024..3ca70594e242 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -933,7 +933,8 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order) | |||
933 | if (codec_dai->driver->remove) { | 933 | if (codec_dai->driver->remove) { |
934 | err = codec_dai->driver->remove(codec_dai); | 934 | err = codec_dai->driver->remove(codec_dai); |
935 | if (err < 0) | 935 | if (err < 0) |
936 | printk(KERN_ERR "asoc: failed to remove %s\n", codec_dai->name); | 936 | pr_err("asoc: failed to remove %s: %d\n", |
937 | codec_dai->name, err); | ||
937 | } | 938 | } |
938 | codec_dai->probed = 0; | 939 | codec_dai->probed = 0; |
939 | list_del(&codec_dai->card_list); | 940 | list_del(&codec_dai->card_list); |
@@ -945,7 +946,8 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order) | |||
945 | if (platform->driver->remove) { | 946 | if (platform->driver->remove) { |
946 | err = platform->driver->remove(platform); | 947 | err = platform->driver->remove(platform); |
947 | if (err < 0) | 948 | if (err < 0) |
948 | printk(KERN_ERR "asoc: failed to remove %s\n", platform->name); | 949 | pr_err("asoc: failed to remove %s: %d\n", |
950 | platform->name, err); | ||
949 | } | 951 | } |
950 | 952 | ||
951 | /* Make sure all DAPM widgets are freed */ | 953 | /* Make sure all DAPM widgets are freed */ |
@@ -968,7 +970,8 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num, int order) | |||
968 | if (cpu_dai->driver->remove) { | 970 | if (cpu_dai->driver->remove) { |
969 | err = cpu_dai->driver->remove(cpu_dai); | 971 | err = cpu_dai->driver->remove(cpu_dai); |
970 | if (err < 0) | 972 | if (err < 0) |
971 | printk(KERN_ERR "asoc: failed to remove %s\n", cpu_dai->name); | 973 | pr_err("asoc: failed to remove %s: %d\n", |
974 | cpu_dai->name, err); | ||
972 | } | 975 | } |
973 | cpu_dai->probed = 0; | 976 | cpu_dai->probed = 0; |
974 | list_del(&cpu_dai->card_list); | 977 | list_del(&cpu_dai->card_list); |
@@ -1224,8 +1227,8 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order) | |||
1224 | if (cpu_dai->driver->probe) { | 1227 | if (cpu_dai->driver->probe) { |
1225 | ret = cpu_dai->driver->probe(cpu_dai); | 1228 | ret = cpu_dai->driver->probe(cpu_dai); |
1226 | if (ret < 0) { | 1229 | if (ret < 0) { |
1227 | printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n", | 1230 | pr_err("asoc: failed to probe CPU DAI %s: %d\n", |
1228 | cpu_dai->name); | 1231 | cpu_dai->name, ret); |
1229 | module_put(cpu_dai->dev->driver->owner); | 1232 | module_put(cpu_dai->dev->driver->owner); |
1230 | return ret; | 1233 | return ret; |
1231 | } | 1234 | } |
@@ -1256,8 +1259,8 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order) | |||
1256 | if (codec_dai->driver->probe) { | 1259 | if (codec_dai->driver->probe) { |
1257 | ret = codec_dai->driver->probe(codec_dai); | 1260 | ret = codec_dai->driver->probe(codec_dai); |
1258 | if (ret < 0) { | 1261 | if (ret < 0) { |
1259 | printk(KERN_ERR "asoc: failed to probe CODEC DAI %s\n", | 1262 | pr_err("asoc: failed to probe CODEC DAI %s: %d\n", |
1260 | codec_dai->name); | 1263 | codec_dai->name, ret); |
1261 | return ret; | 1264 | return ret; |
1262 | } | 1265 | } |
1263 | } | 1266 | } |
@@ -1277,12 +1280,13 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num, int order) | |||
1277 | 1280 | ||
1278 | ret = device_create_file(rtd->dev, &dev_attr_pmdown_time); | 1281 | ret = device_create_file(rtd->dev, &dev_attr_pmdown_time); |
1279 | if (ret < 0) | 1282 | if (ret < 0) |
1280 | printk(KERN_WARNING "asoc: failed to add pmdown_time sysfs\n"); | 1283 | pr_warn("asoc: failed to add pmdown_time sysfs:%d\n", ret); |
1281 | 1284 | ||
1282 | /* create the pcm */ | 1285 | /* create the pcm */ |
1283 | ret = soc_new_pcm(rtd, num); | 1286 | ret = soc_new_pcm(rtd, num); |
1284 | if (ret < 0) { | 1287 | if (ret < 0) { |
1285 | printk(KERN_ERR "asoc: can't create pcm %s\n", dai_link->stream_name); | 1288 | pr_err("asoc: can't create pcm %s :%d\n", |
1289 | dai_link->stream_name, ret); | ||
1286 | return ret; | 1290 | return ret; |
1287 | } | 1291 | } |
1288 | 1292 | ||
@@ -1315,7 +1319,7 @@ static int soc_register_ac97_dai_link(struct snd_soc_pcm_runtime *rtd) | |||
1315 | 1319 | ||
1316 | ret = soc_ac97_dev_register(rtd->codec); | 1320 | ret = soc_ac97_dev_register(rtd->codec); |
1317 | if (ret < 0) { | 1321 | if (ret < 0) { |
1318 | printk(KERN_ERR "asoc: AC97 device register failed\n"); | 1322 | pr_err("asoc: AC97 device register failed:%d\n", ret); |
1319 | return ret; | 1323 | return ret; |
1320 | } | 1324 | } |
1321 | 1325 | ||
@@ -1455,8 +1459,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1455 | ret = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, | 1459 | ret = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, |
1456 | card->owner, 0, &card->snd_card); | 1460 | card->owner, 0, &card->snd_card); |
1457 | if (ret < 0) { | 1461 | if (ret < 0) { |
1458 | printk(KERN_ERR "asoc: can't create sound card for card %s\n", | 1462 | pr_err("asoc: can't create sound card for card %s: %d\n", |
1459 | card->name); | 1463 | card->name, ret); |
1460 | mutex_unlock(&card->mutex); | 1464 | mutex_unlock(&card->mutex); |
1461 | return; | 1465 | return; |
1462 | } | 1466 | } |
@@ -1576,7 +1580,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1576 | 1580 | ||
1577 | ret = snd_card_register(card->snd_card); | 1581 | ret = snd_card_register(card->snd_card); |
1578 | if (ret < 0) { | 1582 | if (ret < 0) { |
1579 | printk(KERN_ERR "asoc: failed to register soundcard for %s\n", card->name); | 1583 | pr_err("asoc: failed to register soundcard for %s: %d\n", |
1584 | card->name, ret); | ||
1580 | goto probe_aux_dev_err; | 1585 | goto probe_aux_dev_err; |
1581 | } | 1586 | } |
1582 | 1587 | ||
@@ -1585,7 +1590,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) | |||
1585 | for (i = 0; i < card->num_rtd; i++) { | 1590 | for (i = 0; i < card->num_rtd; i++) { |
1586 | ret = soc_register_ac97_dai_link(&card->rtd[i]); | 1591 | ret = soc_register_ac97_dai_link(&card->rtd[i]); |
1587 | if (ret < 0) { | 1592 | if (ret < 0) { |
1588 | printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name); | 1593 | pr_err("asoc: failed to register AC97 %s: %d\n", |
1594 | card->name, ret); | ||
1589 | while (--i >= 0) | 1595 | while (--i >= 0) |
1590 | soc_unregister_ac97_dai_link(card->rtd[i].codec); | 1596 | soc_unregister_ac97_dai_link(card->rtd[i].codec); |
1591 | goto probe_aux_dev_err; | 1597 | goto probe_aux_dev_err; |
@@ -3083,7 +3089,7 @@ static inline char *fmt_multiple_name(struct device *dev, | |||
3083 | struct snd_soc_dai_driver *dai_drv) | 3089 | struct snd_soc_dai_driver *dai_drv) |
3084 | { | 3090 | { |
3085 | if (dai_drv->name == NULL) { | 3091 | if (dai_drv->name == NULL) { |
3086 | printk(KERN_ERR "asoc: error - multiple DAI %s registered with no name\n", | 3092 | pr_err("asoc: error - multiple DAI %s registered with no name\n", |
3087 | dev_name(dev)); | 3093 | dev_name(dev)); |
3088 | return NULL; | 3094 | return NULL; |
3089 | } | 3095 | } |
@@ -3555,8 +3561,7 @@ static int __init snd_soc_init(void) | |||
3555 | #ifdef CONFIG_DEBUG_FS | 3561 | #ifdef CONFIG_DEBUG_FS |
3556 | snd_soc_debugfs_root = debugfs_create_dir("asoc", NULL); | 3562 | snd_soc_debugfs_root = debugfs_create_dir("asoc", NULL); |
3557 | if (IS_ERR(snd_soc_debugfs_root) || !snd_soc_debugfs_root) { | 3563 | if (IS_ERR(snd_soc_debugfs_root) || !snd_soc_debugfs_root) { |
3558 | printk(KERN_WARNING | 3564 | pr_warn("ASoC: Failed to create debugfs directory\n"); |
3559 | "ASoC: Failed to create debugfs directory\n"); | ||
3560 | snd_soc_debugfs_root = NULL; | 3565 | snd_soc_debugfs_root = NULL; |
3561 | } | 3566 | } |
3562 | 3567 | ||