All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [alsa-devel] [PATCH v2 06/15] ASoC: soc-core: move snd_soc_find_dai_link()
Date: 25 Nov 2019 09:44:33 +0900	[thread overview]
Message-ID: <87y2w4eqdq.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <877e3og50x.wl-kuninori.morimoto.gx@renesas.com>


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

snd_soc_find_dai_link() is soc-topology specific function.
We don't need to have it at soc-core.
This patch moves it to soc-topology.c

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
---
v1 -> v2
	- no change

 include/sound/soc.h      |  3 ---
 sound/soc/soc-core.c     | 44 --------------------------------------------
 sound/soc/soc-topology.c | 41 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 41 insertions(+), 47 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 40c2a67..09d3d9b 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1327,9 +1327,6 @@ 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 *snd_soc_find_dai_link(struct snd_soc_card *card,
-					       int id, const char *name,
-					       const char *stream_name);
 
 struct snd_soc_dai *snd_soc_register_dai(struct snd_soc_component *component,
 					 struct snd_soc_dai_driver *dai_drv,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 3373615..3221e776 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -901,50 +901,6 @@ struct snd_soc_dai *snd_soc_find_dai(
 }
 EXPORT_SYMBOL_GPL(snd_soc_find_dai);
 
-/**
- * snd_soc_find_dai_link - Find a DAI link
- *
- * @card: soc card
- * @id: DAI link ID to match
- * @name: DAI link name to match, optional
- * @stream_name: DAI link stream name to match, optional
- *
- * This function will search all existing DAI links of the soc card to
- * find the link of the same ID. Since DAI links may not have their
- * unique ID, so name and stream name should also match if being
- * specified.
- *
- * Return: pointer of DAI link, or NULL if not found.
- */
-struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card,
-					       int id, const char *name,
-					       const char *stream_name)
-{
-	struct snd_soc_pcm_runtime *rtd;
-	struct snd_soc_dai_link *link;
-
-	lockdep_assert_held(&client_mutex);
-
-	for_each_card_rtds(card, rtd) {
-		link = rtd->dai_link;
-
-		if (link->id != id)
-			continue;
-
-		if (name && (!link->name || strcmp(name, link->name)))
-			continue;
-
-		if (stream_name && (!link->stream_name
-			|| strcmp(stream_name, link->stream_name)))
-			continue;
-
-		return link;
-	}
-
-	return NULL;
-}
-EXPORT_SYMBOL_GPL(snd_soc_find_dai_link);
-
 static int soc_dai_link_sanity_check(struct snd_soc_card *card,
 				     struct snd_soc_dai_link *link)
 {
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 81d2af0..cbd605b 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -2207,6 +2207,47 @@ static int link_new_ver(struct soc_tplg *tplg,
 	return 0;
 }
 
+/**
+ * snd_soc_find_dai_link - Find a DAI link
+ *
+ * @card: soc card
+ * @id: DAI link ID to match
+ * @name: DAI link name to match, optional
+ * @stream_name: DAI link stream name to match, optional
+ *
+ * This function will search all existing DAI links of the soc card to
+ * find the link of the same ID. Since DAI links may not have their
+ * unique ID, so name and stream name should also match if being
+ * specified.
+ *
+ * Return: pointer of DAI link, or NULL if not found.
+ */
+static struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card,
+						      int id, const char *name,
+						      const char *stream_name)
+{
+	struct snd_soc_pcm_runtime *rtd;
+	struct snd_soc_dai_link *link;
+
+	for_each_card_rtds(card, rtd) {
+		link = rtd->dai_link;
+
+		if (link->id != id)
+			continue;
+
+		if (name && (!link->name || strcmp(name, link->name)))
+			continue;
+
+		if (stream_name && (!link->stream_name
+				    || strcmp(stream_name, link->stream_name)))
+			continue;
+
+		return link;
+	}
+
+	return NULL;
+}
+
 /* Find and configure an existing physical DAI link */
 static int soc_tplg_link_config(struct soc_tplg *tplg,
 	struct snd_soc_tplg_link_config *cfg)
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-11-25  0:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-25  0:42 [alsa-devel] [PATCH v2 00/15] ASoC: soc-core cleanup step6 Kuninori Morimoto
2019-11-25  0:43 ` [alsa-devel] [PATCH v2 01/15] ASoC: soc-core: remove dai_link_list Kuninori Morimoto
2019-11-25  0:43 ` [alsa-devel] [PATCH v2 02/15] ASoC: soc-core: remove snd_soc_disconnect_sync() Kuninori Morimoto
2019-11-25  0:43 ` [alsa-devel] [PATCH v2 03/15] ASoC: soc-core: remove snd_soc_get_dai_substream() Kuninori Morimoto
2019-11-25  0:43 ` [alsa-devel] [PATCH v2 04/15] ASoC: soc-core: move snd_soc_get_pcm_runtime() Kuninori Morimoto
2019-11-25  0:44 ` [alsa-devel] [PATCH v2 05/15] ASoC: soc-core: find rtd via dai_link pointer at snd_soc_get_pcm_runtime() Kuninori Morimoto
2019-11-25  0:44 ` Kuninori Morimoto [this message]
2019-11-25  0:44 ` [alsa-devel] [PATCH v2 07/15] ASoC: soc-core: rename snd_soc_add_dai_link() to snd_soc_add_pcm_runtime() Kuninori Morimoto
2019-11-25  0:45 ` [alsa-devel] [PATCH v2 08/15] ASoC: soc-core: rename snd_soc_remove_dai_link() to snd_soc_remove_pcm_runtime() Kuninori Morimoto
2019-11-25  0:45 ` [alsa-devel] [PATCH v2 09/15] ASoC: soc-core: move soc_link_dai_pcm_new() Kuninori Morimoto
2019-11-25  0:45 ` [alsa-devel] [PATCH v2 10/15] ASoC: soc-core: rename soc_link_dai_pcm_new() to soc_dai_pcm_new() Kuninori Morimoto
2019-11-25  0:45 ` [alsa-devel] [PATCH v2 11/15] ASoC: soc-core: move soc_link_init() Kuninori Morimoto
2019-11-25  0:45 ` [alsa-devel] [PATCH v2 12/15] ASoC: soc-core: add missing return value check for soc_link_init() Kuninori Morimoto
2019-11-27  2:56   ` Pierre-Louis Bossart
2019-11-27  6:48     ` Kuninori Morimoto
2019-12-02 17:20       ` Pierre-Louis Bossart
2019-11-25  0:45 ` [alsa-devel] [PATCH v2 13/15] ASoC: soc-core: rename soc_link_init() to soc_init_pcm_runtime() Kuninori Morimoto
2019-11-25  0:45 ` [alsa-devel] [PATCH v2 14/15] ASoC: soc-core: soc_set_name_prefix(): tidyup loop condition Kuninori Morimoto
2019-11-25  0:45 ` [alsa-devel] [PATCH v2 15/15] ASoC: soc-core: soc_set_name_prefix(): get component device_node at out of loop Kuninori Morimoto
2019-11-25 15:29 ` [alsa-devel] [PATCH v2 00/15] ASoC: soc-core cleanup step6 Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2w4eqdq.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.