summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 977a7bfad519..e3a53ef1db04 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -419,6 +419,9 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd)
list_del(&rtd->list);
+ flush_delayed_work(&rtd->delayed_work);
+ snd_soc_pcm_component_free(rtd);
+
/*
* we don't need to call kfree() for rtd->dev
* see
@@ -1945,19 +1948,14 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card,
{
struct snd_soc_dai_link *link, *_link;
- /* This should be called before snd_card_free() */
- soc_remove_link_components(card);
-
- /* free the ALSA card at first; this syncs with pending operations */
- if (card->snd_card) {
- snd_card_free(card->snd_card);
- card->snd_card = NULL;
- }
+ if (card->snd_card)
+ snd_card_disconnect_sync(card->snd_card);
snd_soc_dapm_shutdown(card);
/* remove and free each DAI */
soc_remove_link_dais(card);
+ soc_remove_link_components(card);
for_each_card_links_safe(card, link, _link)
snd_soc_remove_dai_link(card, link);
@@ -1972,6 +1970,11 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card,
/* remove the card */
if (card_probed && card->remove)
card->remove(card);
+
+ if (card->snd_card) {
+ snd_card_free(card->snd_card);
+ card->snd_card = NULL;
+ }
}
static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister)