ASoC: soc-card: add snd_soc_card_remove()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 28 May 2020 01:49:26 +0000 (10:49 +0900)
committerMark Brown <broonie@kernel.org>
Sat, 30 May 2020 01:11:38 +0000 (02:11 +0100)
Card related function should be implemented at soc-card now.
This patch adds it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87tv00zv4p.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-card.h
sound/soc/soc-card.c
sound/soc/soc-core.c

index 521dc05e4e9f57e91ac731c3323d3a6e3013df1d..97a34f0b0d2faabc8ba8d12b47b9838cf411d37c 100644 (file)
@@ -26,6 +26,7 @@ int snd_soc_card_resume_post(struct snd_soc_card *card);
 
 int snd_soc_card_probe(struct snd_soc_card *card);
 int snd_soc_card_late_probe(struct snd_soc_card *card);
+int snd_soc_card_remove(struct snd_soc_card *card);
 
 /* device driver data */
 static inline void snd_soc_card_set_drvdata(struct snd_soc_card *card,
index 317771d87e3fca0d7bf18e243a72bc454518c94f..920967a9a5ea853c43290422d6e3e08049fea58f 100644 (file)
@@ -166,3 +166,16 @@ int snd_soc_card_late_probe(struct snd_soc_card *card)
 
        return 0;
 }
+
+int snd_soc_card_remove(struct snd_soc_card *card)
+{
+       int ret = 0;
+
+       if (card->probed &&
+           card->remove)
+               ret = card->remove(card);
+
+       card->probed = 0;
+
+       return soc_card_ret(card, ret);
+}
index 42e8c11a0b26a3ff07ed0aca4cddac5ad62f1523..136ff7237a808c287a5f1217397df5e550f14ec8 100644 (file)
@@ -1747,9 +1747,7 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card)
        soc_cleanup_card_debugfs(card);
 
        /* remove the card */
-       if (card->probed && card->remove)
-               card->remove(card);
-       card->probed = 0;
+       snd_soc_card_remove(card);
 
        if (card->snd_card) {
                snd_card_free(card->snd_card);