aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8731.c
diff options
context:
space:
mode:
authorLiam Girdwood <lg@opensource.wolfsonmicro.com>2007-01-31 04:02:23 -0500
committerJaroslav Kysela <perex@suse.cz>2007-02-09 03:03:22 -0500
commite35115a58856ced315cb8f75df56e9b9a816e70a (patch)
tree7aa86aba3c4ed36271ca46d82bf98481a84f901f /sound/soc/codecs/wm8731.c
parent877b866d86786ac69d3d939905999fe7fe1e23fd (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/wm8731.c')
-rw-r--r--sound/soc/codecs/wm8731.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 8151b45a280c..9956d654b6f3 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -696,8 +696,8 @@ static int wm8731_init(struct snd_soc_device *socdev)
696 /* register pcms */ 696 /* register pcms */
697 ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); 697 ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
698 if (ret < 0) { 698 if (ret < 0) {
699 kfree(codec->reg_cache); 699 printk(KERN_ERR "wm8731: failed to create pcms\n");
700 return ret; 700 goto pcm_err;
701 } 701 }
702 702
703 /* power on device */ 703 /* power on device */
@@ -717,11 +717,18 @@ static int wm8731_init(struct snd_soc_device *socdev)
717 wm8731_add_widgets(codec); 717 wm8731_add_widgets(codec);
718 ret = snd_soc_register_card(socdev); 718 ret = snd_soc_register_card(socdev);
719 if (ret < 0) { 719 if (ret < 0) {
720 snd_soc_free_pcms(socdev); 720 printk(KERN_ERR "wm8731: failed to register card\n");
721 snd_soc_dapm_free(socdev); 721 goto card_err;
722 } 722 }
723 723
724 return ret; 724 return ret;
725
726card_err:
727 snd_soc_free_pcms(socdev);
728 snd_soc_dapm_free(socdev);
729pcm_err:
730 kfree(codec->reg_cache);
731 return ret;
725} 732}
726 733
727static struct snd_soc_device *wm8731_socdev; 734static struct snd_soc_device *wm8731_socdev;