summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8750.c
diff options
context:
space:
mode:
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>2007-01-31 12:02:23 +0300
committerJaroslav Kysela <perex@suse.cz>2007-02-09 11:03:22 +0300
commite35115a58856ced315cb8f75df56e9b9a816e70a (patch)
tree7aa86aba3c4ed36271ca46d82bf98481a84f901f /sound/soc/codecs/wm8750.c
parent877b866d86786ac69d3d939905999fe7fe1e23fd (diff)
downloadlinux-e35115a58856ced315cb8f75df56e9b9a816e70a.tar.xz
[ALSA] ASoC codec error reporting
This patch improves the codec probe() error reporting by printing error messages when the card or pcms fail to register. Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/soc/codecs/wm8750.c')
-rw-r--r--sound/soc/codecs/wm8750.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8750.c b/sound/soc/codecs/wm8750.c
index e7f04b89c8a0..d4a288ba644b 100644
--- a/sound/soc/codecs/wm8750.c
+++ b/sound/soc/codecs/wm8750.c
@@ -1075,8 +1075,8 @@ static int wm8750_init(struct snd_soc_device *socdev)
/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0) {
- kfree(codec->reg_cache);
- return ret;
+ printk(KERN_ERR "wm8750: failed to create pcms\n");
+ goto pcm_err;
}
/* charge output caps */
@@ -1106,10 +1106,16 @@ static int wm8750_init(struct snd_soc_device *socdev)
wm8750_add_widgets(codec);
ret = snd_soc_register_card(socdev);
if (ret < 0) {
- snd_soc_free_pcms(socdev);
- snd_soc_dapm_free(socdev);
+ printk(KERN_ERR "wm8750: failed to register card\n");
+ goto card_err;
}
+ return ret;
+card_err:
+ snd_soc_free_pcms(socdev);
+ snd_soc_dapm_free(socdev);
+pcm_err:
+ kfree(codec->reg_cache);
return ret;
}