From patchwork Mon Feb 9 08:06:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5798951 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 630829F336 for ; Mon, 9 Feb 2015 08:07:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 867FD2013A for ; Mon, 9 Feb 2015 08:07:57 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 853C920123 for ; Mon, 9 Feb 2015 08:07:55 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A17EF26063C; Mon, 9 Feb 2015 09:07:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 3380F2605B6; Mon, 9 Feb 2015 09:06:56 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 59E5B2605AA; Mon, 9 Feb 2015 09:06:53 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id C21A72605CA for ; Mon, 9 Feb 2015 09:06:13 +0100 (CET) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 09 Feb 2015 17:06:12 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 499894152A; Mon, 9 Feb 2015 17:06:12 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 35B2018071; Mon, 9 Feb 2015 17:06:11 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id B0A5918070; Mon, 9 Feb 2015 17:06:11 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id TAK21546; Mon, 9 Feb 2015 17:06:11 +0900 X-IronPort-AV: E=Sophos;i="5.09,542,1418050800"; d="scan'208";a="180591800" Received: from mail-hk1lp0120.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.120]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 09 Feb 2015 17:06:08 +0900 Received: from remon.renesas.com (211.11.155.132) by SINPR06MB172.apcprd06.prod.outlook.com (10.242.57.21) with Microsoft SMTP Server (TLS) id 15.1.81.19; Mon, 9 Feb 2015 08:06:07 +0000 Message-ID: <8761bbwlsf.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <87a90nwlur.wl%kuninori.morimoto.gx@renesas.com> References: <87h9v4gbhg.wl%kuninori.morimoto.gx@renesas.com> <87iofj7qhc.wl%kuninori.morimoto.gx@renesas.com> <20150204205503.GM21293@sirena.org.uk> <87a90nwlur.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Mon, 9 Feb 2015 08:06:07 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: HKXPR02CA0050.apcprd02.prod.outlook.com (25.161.48.35) To SINPR06MB172.apcprd06.prod.outlook.com (10.242.57.21) Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB172; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:SINPR06MB172; X-Forefront-PRVS: 04825EA361 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(76176999)(54356999)(50986999)(53416004)(46102003)(92566002)(77096005)(122386002)(40100003)(42186005)(2950100001)(47776003)(33646002)(66066001)(229853001)(86362001)(50466002)(36756003)(77156002)(62966003)(19580395003)(19580405001)(46406003)(87976001)(23726002)(110136001); DIR:OUT; SFP:1102; SCL:1; SRVR:SINPR06MB172; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB172; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2015 08:06:07.0076 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SINPR06MB172 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 3/6] ASoC: soc-core: add snd_soc_remove_card() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP 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 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); }