diff mbox series

[19/19] ASoC: soc-card: add snd_soc_card_remove_dai_link()

Message ID 87pnar1oir.wl-kuninori.morimoto.gx@renesas.com
State Accepted
Commit fcbbcc325bc2dd90212de19b520c190b6fbeddae
Headers show
Series [01/19] ASoC: soc.h: convert bool to bit field for snd_soc_card | expand

Commit Message

Kuninori Morimoto May 26, 2020, 1:19 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc-card.h | 2 ++
 sound/soc/soc-card.c     | 8 ++++++++
 sound/soc/soc-core.c     | 3 +--
 3 files changed, 11 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/sound/soc-card.h b/include/sound/soc-card.h
index 501d3d5b6efb..267f613b6690 100644
--- a/include/sound/soc-card.h
+++ b/include/sound/soc-card.h
@@ -37,6 +37,8 @@  int snd_soc_card_set_bias_level_post(struct snd_soc_card *card,
 
 int snd_soc_card_add_dai_link(struct snd_soc_card *card,
 			      struct snd_soc_dai_link *dai_link);
+void snd_soc_card_remove_dai_link(struct snd_soc_card *card,
+				  struct snd_soc_dai_link *dai_link);
 
 /* device driver data */
 static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
diff --git a/sound/soc/soc-card.c b/sound/soc/soc-card.c
index 3886e6f2dbc3..1d5c5b460e39 100644
--- a/sound/soc/soc-card.c
+++ b/sound/soc/soc-card.c
@@ -208,3 +208,11 @@  int snd_soc_card_add_dai_link(struct snd_soc_card *card,
 	return soc_card_ret(card, ret);
 }
 EXPORT_SYMBOL_GPL(snd_soc_card_add_dai_link);
+
+void snd_soc_card_remove_dai_link(struct snd_soc_card *card,
+				  struct snd_soc_dai_link *dai_link)
+{
+	if (card->remove_dai_link)
+		card->remove_dai_link(card, dai_link);
+}
+EXPORT_SYMBOL_GPL(snd_soc_card_remove_dai_link);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index d238b47252a5..b07eca2c6ccc 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -947,8 +947,7 @@  void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
 	/*
 	 * Notify the machine driver for extra destruction
 	 */
-	if (card->remove_dai_link)
-		card->remove_dai_link(card, rtd->dai_link);
+	snd_soc_card_remove_dai_link(card, rtd->dai_link);
 
 	soc_free_pcm_runtime(rtd);
 }