diff mbox

[3/6] ASoC: soc-core: add snd_soc_remove_card()

Message ID 8761bbwlsf.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto Feb. 9, 2015, 8:06 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Added snd_soc_remove_card() is termination method of
snd_soc_instantiate_card()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-core.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 11c28fd..39a8cab 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1715,6 +1715,14 @@  static int soc_cleanup_card_resources(struct snd_soc_card *card)
 
 }
 
+static void snd_soc_remove_card(struct snd_soc_card *card)
+{
+	card->instantiated = false;
+	snd_soc_dapm_shutdown(card);
+	soc_cleanup_card_resources(card);
+}
+
+
 /* removes a socdev */
 static int soc_remove(struct platform_device *pdev)
 {
@@ -2383,9 +2391,7 @@  EXPORT_SYMBOL_GPL(snd_soc_register_card);
 int snd_soc_unregister_card(struct snd_soc_card *card)
 {
 	if (card->instantiated) {
-		card->instantiated = false;
-		snd_soc_dapm_shutdown(card);
-		soc_cleanup_card_resources(card);
+		snd_soc_remove_card(card);
 		dev_dbg(card->dev, "ASoC: Unregistered card '%s'\n",
 			card->name);
 	}