From patchwork Mon Feb 9 08:52:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5799881 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D47B6BF440 for ; Mon, 9 Feb 2015 08:52:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1805720121 for ; Mon, 9 Feb 2015 08:52:51 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 0C72120103 for ; Mon, 9 Feb 2015 08:52:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1A6192606AC; Mon, 9 Feb 2015 09:52:49 +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 4F7ED26067D; Mon, 9 Feb 2015 09:52:37 +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 D2EE32606E0; Mon, 9 Feb 2015 09:52:31 +0100 (CET) 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) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 09 Feb 2015 17:52:10 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id E84A54D40C; Mon, 9 Feb 2015 17:52:10 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id CDD338002E; Mon, 9 Feb 2015 17:52:10 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id C780D8002D; Mon, 9 Feb 2015 17:52:10 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac1.idc.renesas.com with ESMTP id TAA03726; Mon, 9 Feb 2015 17:52:10 +0900 X-IronPort-AV: E=Sophos;i="5.09,542,1418050800"; d="scan'208";a="179466072" Received: from mail-sg1lp0091.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.91]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 09 Feb 2015 17:52:10 +0900 Received: from remon.renesas.com (211.11.155.132) by HKXPR06MB168.apcprd06.prod.outlook.com (10.242.124.21) with Microsoft SMTP Server (TLS) id 15.1.75.20; Mon, 9 Feb 2015 08:52:01 +0000 Message-ID: <87r3tzv53g.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: <87siefv54e.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") Date: Mon, 9 Feb 2015 08:52:01 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: SG2PR03CA0009.apcprd03.prod.outlook.com (25.160.233.19) To HKXPR06MB168.apcprd06.prod.outlook.com (10.242.124.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:HKXPR06MB168; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:HKXPR06MB168; X-Forefront-PRVS: 04825EA361 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(979002)(6009001)(229853001)(76176999)(110136001)(77096005)(87976001)(2950100001)(36756003)(50466002)(40100003)(86362001)(77156002)(62966003)(122386002)(46406003)(23726002)(83506001)(50986999)(33646002)(47776003)(54356999)(46102003)(19580405001)(42186005)(19580395003)(66066001)(53416004)(92566002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB168; H:remon.renesas.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB168; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2015 08:52:01.5745 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB168 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 1/4] 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 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); }