ASoC: audio-graph: move audio_graph_remove() to simple-card-utils.c
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 19 Apr 2021 02:02:25 +0000 (11:02 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 20 Apr 2021 16:25:45 +0000 (17:25 +0100)
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>
Link: https://lore.kernel.org/r/87y2df3uby.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/graph_card.h
include/sound/simple_card_utils.h
sound/soc/generic/audio-graph-card.c
sound/soc/generic/simple-card-utils.c
sound/soc/generic/simple-card.c
sound/soc/tegra/tegra_audio_graph_card.c

index 9c2feb7..6f10bfb 100644 (file)
@@ -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 */
index 656c7e3..51b3b48 100644 (file)
@@ -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,
index 6cac167..976c1ea 100644 (file)
@@ -743,14 +743,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",
@@ -766,7 +758,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);
 
index ed2cad6..fa1247f 100644 (file)
@@ -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);
index ca27cb9..a1373be 100644 (file)
@@ -708,13 +708,6 @@ err:
        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",
index 35d008b..1f2c501 100644 (file)
@@ -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);