diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-12-09 08:24:32 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-12-09 08:24:32 +0100 |
commit | d70ab7f7ee0692efc880d772dc5c212174d67e3b (patch) | |
tree | 82731bc8ccd773922df644881b2570d9c3702e8a /sound/soc/soc-core.c | |
parent | 58936b29c4c3e633a92bb918409fe1f0ca148144 (diff) | |
parent | 2a7b1a00206895cfa444fd83477dca67a88a9d25 (diff) |
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 441285ade02..85b7d548f16 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1619,12 +1619,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) #ifdef CONFIG_SND_SOC_AC97_BUS /* register any AC97 codecs */ for (i = 0; i < card->num_rtd; i++) { - ret = soc_register_ac97_dai_link(&card->rtd[i]); - if (ret < 0) { - printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name); - goto probe_dai_err; - } + ret = soc_register_ac97_dai_link(&card->rtd[i]); + if (ret < 0) { + printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name); + while (--i >= 0) + soc_unregister_ac97_dai_link(&card->rtd[i]); + goto probe_dai_err; } + } #endif card->instantiated = 1; @@ -3072,7 +3074,9 @@ int snd_soc_register_dais(struct device *dev, pr_debug("Registered DAI '%s'\n", dai->name); } + mutex_lock(&client_mutex); snd_soc_instantiate_cards(); + mutex_unlock(&client_mutex); return 0; err: |