summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-11-06 10:07:38 +0900
committerMark Brown <broonie@kernel.org>2019-11-12 18:27:43 +0000
commitda704f26ba376bd93ac5234fa4605c4a8e4a5648 (patch)
tree47b7dcd3246b30e4d78d438b87f532c9b1b9630e /sound
parent63dc47da1f396fecd2373e41928e275f9ca3d924 (diff)
downloadlinux-stable-da704f26ba376bd93ac5234fa4605c4a8e4a5648.tar.gz
linux-stable-da704f26ba376bd93ac5234fa4605c4a8e4a5648.tar.bz2
linux-stable-da704f26ba376bd93ac5234fa4605c4a8e4a5648.zip
ASoC: soc-core: merge snd_soc_remove_dai_link() and soc_unbind_dai_link()
We don't need to separete snd_soc_remove_dai_link() and soc_unbind_dai_link() anymore. Let's merge these. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87pni5hkx1.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-core.c52
1 files changed, 23 insertions, 29 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 8add98431881..d80d485f46d1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1049,15 +1049,36 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card,
return 0;
}
-static void soc_unbind_dai_link(struct snd_soc_card *card,
- struct snd_soc_dai_link *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
+ *
+ * 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_pcm_runtime *rtd;
+ lockdep_assert_held(&client_mutex);
+
+ /*
+ * Notify the machine driver for extra destruction
+ */
+ if (card->remove_dai_link)
+ card->remove_dai_link(card, dai_link);
+
+ list_del(&dai_link->list);
+
rtd = snd_soc_get_pcm_runtime(card, dai_link->name);
if (rtd)
soc_free_pcm_runtime(rtd);
}
+EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link);
/**
* snd_soc_add_dai_link - Add a DAI link dynamically
@@ -1434,33 +1455,6 @@ void snd_soc_disconnect_sync(struct device *dev)
}
EXPORT_SYMBOL_GPL(snd_soc_disconnect_sync);
-/**
- * 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
- *
- * 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)
-{
- lockdep_assert_held(&client_mutex);
-
- /*
- * Notify the machine driver for extra destruction
- */
- if (card->remove_dai_link)
- card->remove_dai_link(card, dai_link);
-
- list_del(&dai_link->list);
-
- soc_unbind_dai_link(card, dai_link);
-}
-EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link);
-
static int soc_link_dai_pcm_new(struct snd_soc_dai **dais, int num_dais,
struct snd_soc_pcm_runtime *rtd)
{