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 08/14] ASoC: soc-core: rename snd_soc_remove_dai_link() to snd_soc_remove_pcm_runtime()
Date: 22 Nov 2019 14:41:07 +0900	[thread overview]
Message-ID: <87ftig8o3w.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87r2208o9g.wl-kuninori.morimoto.gx@renesas.com>

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

Now soc-core and soc-topology is using snd_soc_remove_dai_link().
It sounds like dai_link function.
It removes pcm_runtime (= rtd) and disconnect it from card.
The purpose is removing pcm_runtime, not dai_link.
This patch renames function name.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h      |  4 ++--
 sound/soc/soc-core.c     | 29 +++++++++++------------------
 sound/soc/soc-topology.c |  4 +++-
 3 files changed, 16 insertions(+), 21 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index b223b2d..3923178 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1325,8 +1325,8 @@ void snd_soc_of_put_dai_link_codecs(struct snd_soc_dai_link *dai_link);
 
 int snd_soc_add_pcm_runtime(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);
+void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
+				struct snd_soc_pcm_runtime *rtd);
 
 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 af2eed7..1ad1116 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -998,33 +998,26 @@ static int soc_dai_link_sanity_check(struct snd_soc_card *card,
 }
 
 /**
- * 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
+ * snd_soc_remove_pcm_runtime - Remove a pcm_runtime from card
+ * @card: The ASoC card to which the pcm_runtime has
+ * @rtd: The pcm_runtime 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.
+ * This function removes a pcm_runtime from the ASoC card.
  */
-void snd_soc_remove_dai_link(struct snd_soc_card *card,
-			     struct snd_soc_dai_link *dai_link)
+void snd_soc_remove_pcm_runtime(struct snd_soc_card *card,
+				struct snd_soc_pcm_runtime *rtd)
 {
-	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);
+		card->remove_dai_link(card, rtd->dai_link);
 
-	rtd = snd_soc_get_pcm_runtime(card, dai_link);
-	if (rtd)
-		soc_free_pcm_runtime(rtd);
+	soc_free_pcm_runtime(rtd);
 }
-EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link);
+EXPORT_SYMBOL_GPL(snd_soc_remove_pcm_runtime);
 
 /**
  * snd_soc_add_pcm_runtime - Add a pcm_runtime dynamically via dai_link
@@ -1104,7 +1097,7 @@ int snd_soc_add_pcm_runtime(struct snd_soc_card *card,
 	return 0;
 
 _err_defer:
-	soc_free_pcm_runtime(rtd);
+	snd_soc_remove_pcm_runtime(card, rtd);
 	return -EPROBE_DEFER;
 }
 EXPORT_SYMBOL_GPL(snd_soc_add_pcm_runtime);
@@ -1886,7 +1879,7 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card,
 	soc_remove_link_components(card);
 
 	for_each_card_rtds_safe(card, rtd, n)
-		snd_soc_remove_dai_link(card, rtd->dai_link);
+		snd_soc_remove_pcm_runtime(card, rtd);
 
 	/* remove auxiliary devices */
 	soc_remove_aux_devices(card);
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index de42788..e9b660f 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -553,7 +553,9 @@ 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_pcm_runtime(comp->card,
+			snd_soc_get_pcm_runtime(comp->card, link));
 	kfree(link);
 }
 
-- 
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-22  5:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22  5:37 [alsa-devel] [PATCH 00/14] ASoC: soc-core cleanup step6 Kuninori Morimoto
2019-11-22  5:38 ` [alsa-devel] [PATCH 01/14] ASoC: soc-core: remove dai_link_list Kuninori Morimoto
2019-11-22  5:38 ` [alsa-devel] [PATCH 02/14] ASoC: soc-core: remove snd_soc_disconnect_sync() Kuninori Morimoto
2019-11-22  5:38 ` [alsa-devel] [PATCH 03/14] ASoC: soc-core: remove snd_soc_get_dai_substream() Kuninori Morimoto
2019-11-22  5:39 ` [alsa-devel] [PATCH 04/14] ASoC: soc-core: move snd_soc_get_pcm_runtime() Kuninori Morimoto
2019-11-22 16:22   ` Pierre-Louis Bossart
2019-11-22 16:45   ` Pierre-Louis Bossart
2019-11-22  5:39 ` [alsa-devel] [PATCH 05/14] ASoC: soc-core: find rtd via dai_link pointer at snd_soc_get_pcm_runtime() Kuninori Morimoto
2019-11-22  5:39 ` [alsa-devel] [PATCH 06/14] ASoC: soc-core: move snd_soc_find_dai_link() Kuninori Morimoto
2019-11-22  5:40 ` [alsa-devel] [PATCH 07/14] ASoC: soc-core: rename snd_soc_add_dai_link() to snd_soc_add_pcm_runtime() Kuninori Morimoto
2019-11-22 16:43   ` Pierre-Louis Bossart
2019-11-22  5:41 ` Kuninori Morimoto [this message]
2019-11-22  5:41 ` [alsa-devel] [PATCH 09/14] ASoC: soc-core: move soc_link_dai_pcm_new() Kuninori Morimoto
2019-11-22  5:41 ` [alsa-devel] [PATCH 10/14] ASoC: soc-core: rename soc_link_dai_pcm_new() to soc_dai_pcm_new() Kuninori Morimoto
2019-11-22  5:41 ` [alsa-devel] [PATCH 11/14] ASoC: soc-core: move soc_link_init() Kuninori Morimoto
2019-11-22  5:41 ` [alsa-devel] [PATCH 12/14] ASoC: soc-core: rename soc_link_init() to soc_init_pcm_runtime() Kuninori Morimoto
2019-11-22 16:41   ` Pierre-Louis Bossart
2019-11-22  5:42 ` [alsa-devel] [PATCH 13/14] ASoC: soc-core: soc_set_name_prefix(): tidyup loop condition Kuninori Morimoto
2019-11-22  5:42 ` [alsa-devel] [PATCH 14/14] ASoC: soc-core: soc_set_name_prefix(): get component device_node at out of loop Kuninori Morimoto
2019-11-22 16:49 ` [alsa-devel] [PATCH 00/14] ASoC: soc-core cleanup step6 Pierre-Louis Bossart
2019-11-25  0:01   ` Kuninori Morimoto
2019-11-22 20:34 ` Sridharan, Ranjani
2019-11-25  0:01   ` Kuninori Morimoto

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=87ftig8o3w.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.