diff --git a/include/sound/soc.h b/include/sound/soc.h index e0855dc08d30eb..c599a9f12dda33 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1328,7 +1328,8 @@ void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link); int snd_soc_add_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link); void snd_soc_remove_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link); + struct snd_soc_dai_link *dai_link, + bool unbind); struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, int id, const char *name, const char *stream_name); diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 55014e7ae0d823..762778a7da77bd 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1469,6 +1469,7 @@ EXPORT_SYMBOL_GPL(snd_soc_add_dai_link); * snd_soc_remove_dai_link - Remove a DAI link from the list * @card: The ASoC card that owns the link * @dai_link: The DAI link to remove + * @unbind: unbind dai link * * This function removes a DAI link from the ASoC card's link list. * @@ -1476,7 +1477,8 @@ EXPORT_SYMBOL_GPL(snd_soc_add_dai_link); * remove them by using the dobj embedded in the link. */ void snd_soc_remove_dai_link(struct snd_soc_card *card, - struct snd_soc_dai_link *dai_link) + struct snd_soc_dai_link *dai_link, + bool unbind) { lockdep_assert_held(&client_mutex); @@ -1488,7 +1490,8 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, list_del(&dai_link->list); - soc_unbind_dai_link(card, dai_link); + if (unbind) + soc_unbind_dai_link(card, dai_link); } EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link); @@ -1997,7 +2000,7 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card) soc_remove_link_dais(card); for_each_card_links_safe(card, link, _link) - snd_soc_remove_dai_link(card, link); + snd_soc_remove_dai_link(card, link, true); /* remove auxiliary devices */ soc_remove_aux_devices(card); diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 81d2af000a5c80..8072f8f5db1787 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -553,7 +553,7 @@ static void remove_link(struct snd_soc_component *comp, kfree(link->cpus->dai_name); list_del(&dobj->list); - snd_soc_remove_dai_link(comp->card, link); + snd_soc_remove_dai_link(comp->card, link, false); kfree(link); }