From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: [PATCH 1/4] ASoC: soc-core: add snd_soc_remove_card() Date: Mon, 9 Feb 2015 08:52:01 +0000 Message-ID: <87r3tzv53g.wl%kuninori.morimoto.gx@renesas.com> References: <87siefv54e.wl%kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 917592606AC for ; Mon, 9 Feb 2015 09:52:12 +0100 (CET) In-Reply-To: <87siefv54e.wl%kuninori.morimoto.gx@renesas.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Linux-ALSA , Simon , Liam Girdwood List-Id: alsa-devel@alsa-project.org From: Kuninori Morimoto Added snd_soc_remove_card() is termination method of snd_soc_instantiate_card() Signed-off-by: Kuninori Morimoto --- sound/soc/soc-core.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4bfabc7..4837b5d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1725,6 +1725,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) { @@ -2393,9 +2401,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); } -- 1.7.9.5