Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 6 additions & 3 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1469,14 +1469,16 @@ 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.
*
* For DAI links previously added by topology, topology should
* 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);

Expand All @@ -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);

Expand Down Expand Up @@ -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);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart isnt the simpler thing to just remove soc_unbind_dai_link() from remove_dai_link() and add it after the call to soc_unbind_dai_link()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's what the code initially did, so that's essentially a revert, yes.


/* remove auxiliary devices */
soc_remove_aux_devices(card);
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/soc-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down