X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=sound%2Fsoc%2Fsoc-core.c;h=ff8dd8b44de4984e647c4d74106e133e2a0a58ae;hb=807c3cc057f7f1f0b219d7da47247748a9079687;hp=a5d3685a5d38049313391ddb8e174edd9c28a21b;hpb=42a0ddcd484d0470d4c1b114ffb6be1d35f8ac6b;p=pandora-kernel.git diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a5d3685a5d38..ff8dd8b44de4 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -709,6 +709,12 @@ int snd_soc_resume(struct device *dev) struct snd_soc_card *card = dev_get_drvdata(dev); int i, ac97_control = 0; + /* If the initialization of this soc device failed, there is no codec + * associated with it. Just bail out in this case. + */ + if (list_empty(&card->codec_dev_list)) + return 0; + /* AC97 devices might have other drivers hanging off them so * need to resume immediately. Other drivers don't have that * problem and may take a substantial amount of time to resume @@ -1568,6 +1574,9 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) flush_delayed_work_sync(&rtd->delayed_work); } + /* free the ALSA card at first; this syncs with pending operations */ + snd_card_free(card->snd_card); + /* remove auxiliary devices */ for (i = 0; i < card->num_aux_devs; i++) soc_remove_aux_dev(card, i); @@ -1584,9 +1593,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) snd_soc_dapm_free(&card->dapm); kfree(card->rtd); - snd_card_free(card->snd_card); return 0; - } /* removes a socdev */