diff options
author | Liam Girdwood <lg@opensource.wolfsonmicro.com> | 2007-01-31 04:02:23 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-02-09 03:03:22 -0500 |
commit | e35115a58856ced315cb8f75df56e9b9a816e70a (patch) | |
tree | 7aa86aba3c4ed36271ca46d82bf98481a84f901f /sound/soc/codecs/wm8750.c | |
parent | 877b866d86786ac69d3d939905999fe7fe1e23fd (diff) |
[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.c | 14 |
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) | |||
1075 | /* register pcms */ | 1075 | /* register pcms */ |
1076 | ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); | 1076 | ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); |
1077 | if (ret < 0) { | 1077 | if (ret < 0) { |
1078 | kfree(codec->reg_cache); | 1078 | printk(KERN_ERR "wm8750: failed to create pcms\n"); |
1079 | return ret; | 1079 | goto pcm_err; |
1080 | } | 1080 | } |
1081 | 1081 | ||
1082 | /* charge output caps */ | 1082 | /* charge output caps */ |
@@ -1106,10 +1106,16 @@ static int wm8750_init(struct snd_soc_device *socdev) | |||
1106 | wm8750_add_widgets(codec); | 1106 | wm8750_add_widgets(codec); |
1107 | ret = snd_soc_register_card(socdev); | 1107 | ret = snd_soc_register_card(socdev); |
1108 | if (ret < 0) { | 1108 | if (ret < 0) { |
1109 | snd_soc_free_pcms(socdev); | 1109 | printk(KERN_ERR "wm8750: failed to register card\n"); |
1110 | snd_soc_dapm_free(socdev); | 1110 | goto card_err; |
1111 | } | 1111 | } |
1112 | return ret; | ||
1112 | 1113 | ||
1114 | card_err: | ||
1115 | snd_soc_free_pcms(socdev); | ||
1116 | snd_soc_dapm_free(socdev); | ||
1117 | pcm_err: | ||
1118 | kfree(codec->reg_cache); | ||
1113 | return ret; | 1119 | return ret; |
1114 | } | 1120 | } |
1115 | 1121 | ||