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: [PATCH 2/6] ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c
Date: 19 Apr 2021 11:02:25 +0900	[thread overview]
Message-ID: <87y2df3uby.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <871rb758x7.wl-kuninori.morimoto.gx@renesas.com>

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

audio-graph-card2 can reuse  audio_graph_remove() / asoc_simple_remove().
This patch moves it to simple-card-utils.c.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/graph_card.h               |  2 --
 include/sound/simple_card_utils.h        |  2 +-
 sound/soc/generic/audio-graph-card.c     | 10 +---------
 sound/soc/generic/simple-card-utils.c    |  8 ++++++++
 sound/soc/generic/simple-card.c          |  7 -------
 sound/soc/tegra/tegra_audio_graph_card.c |  2 +-
 6 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/include/sound/graph_card.h b/include/sound/graph_card.h
index 9c2feb792742..6f10bfb0d5ee 100644
--- a/include/sound/graph_card.h
+++ b/include/sound/graph_card.h
@@ -11,6 +11,4 @@
 
 int audio_graph_parse_of(struct asoc_simple_priv *priv, struct device *dev);
 
-int audio_graph_remove(struct platform_device *pdev);
-
 #endif /* __GRAPH_CARD_H */
diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h
index 656c7e30b6e4..51b3b485a92e 100644
--- a/include/sound/simple_card_utils.h
+++ b/include/sound/simple_card_utils.h
@@ -177,10 +177,10 @@ int asoc_simple_init_jack(struct snd_soc_card *card,
 			       int is_hp, char *prefix, char *pin);
 int asoc_simple_init_priv(struct asoc_simple_priv *priv,
 			       struct link_info *li);
+int asoc_simple_remove(struct platform_device *pdev);
 
 int asoc_graph_card_probe(struct snd_soc_card *card);
 
-
 #ifdef DEBUG
 static inline void asoc_simple_debug_dai(struct asoc_simple_priv *priv,
 					 char *name,
diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c
index 2d004a980f0c..54e8be90b109 100644
--- a/sound/soc/generic/audio-graph-card.c
+++ b/sound/soc/generic/audio-graph-card.c
@@ -739,14 +739,6 @@ static int graph_probe(struct platform_device *pdev)
 	return audio_graph_parse_of(priv, dev);
 }
 
-int audio_graph_remove(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	return asoc_simple_clean_reference(card);
-}
-EXPORT_SYMBOL_GPL(audio_graph_remove);
-
 static const struct of_device_id graph_of_match[] = {
 	{ .compatible = "audio-graph-card", },
 	{ .compatible = "audio-graph-scu-card",
@@ -762,7 +754,7 @@ static struct platform_driver graph_card = {
 		.of_match_table = graph_of_match,
 	},
 	.probe = graph_probe,
-	.remove = audio_graph_remove,
+	.remove = asoc_simple_remove,
 };
 module_platform_driver(graph_card);
 
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index ed2cad6d9ac1..fa1247f0dda1 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -740,6 +740,14 @@ int asoc_simple_init_priv(struct asoc_simple_priv *priv,
 }
 EXPORT_SYMBOL_GPL(asoc_simple_init_priv);
 
+int asoc_simple_remove(struct platform_device *pdev)
+{
+	struct snd_soc_card *card = platform_get_drvdata(pdev);
+
+	return asoc_simple_clean_reference(card);
+}
+EXPORT_SYMBOL_GPL(asoc_simple_remove);
+
 int asoc_graph_card_probe(struct snd_soc_card *card)
 {
 	struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card);
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 8b9964d25757..ece7dac3e8c5 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -705,13 +705,6 @@ static int asoc_simple_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int asoc_simple_remove(struct platform_device *pdev)
-{
-	struct snd_soc_card *card = platform_get_drvdata(pdev);
-
-	return asoc_simple_clean_reference(card);
-}
-
 static const struct of_device_id simple_of_match[] = {
 	{ .compatible = "simple-audio-card", },
 	{ .compatible = "simple-scu-audio-card",
diff --git a/sound/soc/tegra/tegra_audio_graph_card.c b/sound/soc/tegra/tegra_audio_graph_card.c
index 35d008b5d373..1f2c5018bf5a 100644
--- a/sound/soc/tegra/tegra_audio_graph_card.c
+++ b/sound/soc/tegra/tegra_audio_graph_card.c
@@ -244,7 +244,7 @@ static struct platform_driver tegra_audio_graph_card = {
 		.of_match_table = graph_of_tegra_match,
 	},
 	.probe = tegra_audio_graph_probe,
-	.remove = audio_graph_remove,
+	.remove = asoc_simple_remove,
 };
 module_platform_driver(tegra_audio_graph_card);
 
-- 
2.25.1


  parent reply	other threads:[~2021-04-19  2:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19  2:01 [PATCH 0/6] ASoC: audio-graph: cleanups Kuninori Morimoto
2021-04-19  2:02 ` [PATCH 1/6] ASoC: audio-graph: move audio_graph_card_probe() to simple-card-utils.c Kuninori Morimoto
2021-04-19  2:02 ` Kuninori Morimoto [this message]
2021-04-19  2:02 ` [PATCH 3/6] ASoC: audio-graph: check ports if exists Kuninori Morimoto
2021-04-19  2:02 ` [PATCH 4/6] ASoC: audio-graph: remove "audio-graph-card, " preix support Kuninori Morimoto
2021-04-19  2:02 ` [PATCH 5/6] ASoC: audio-graph: remove unused "node" from graph_parse_mclk_fs() Kuninori Morimoto
2021-04-19  2:02 ` [PATCH 6/6] ASoC: audio-graph: remove Platform support Kuninori Morimoto
2021-08-25  7:18   ` Olivier MOYSAN
2021-08-25 22:48     ` Kuninori Morimoto
2021-08-27 15:28       ` Olivier MOYSAN
2021-04-20 18:35 ` [PATCH 0/6] ASoC: audio-graph: cleanups Mark Brown

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