[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>
This commit is contained in:
Liam Girdwood
2007-01-31 10:02:23 +01:00
committed by Jaroslav Kysela
parent 877b866d86
commit e35115a588
3 changed files with 34 additions and 17 deletions

View File

@@ -696,8 +696,8 @@ static int wm8731_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 "wm8731: failed to create pcms\n");
goto pcm_err;
}
/* power on device */
@@ -717,11 +717,18 @@ static int wm8731_init(struct snd_soc_device *socdev)
wm8731_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 "wm8731: 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;
}
static struct snd_soc_device *wm8731_socdev;