From patchwork Fri Feb 13 04:43:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5822891 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 B531EBF440 for ; Fri, 13 Feb 2015 04:44:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E71562025B for ; Fri, 13 Feb 2015 04:44:02 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CEBBF200F0 for ; Fri, 13 Feb 2015 04:44:01 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1E84926547A; Fri, 13 Feb 2015 05:43:56 +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 D1559265367; Fri, 13 Feb 2015 05:43:41 +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 0CDE4265344; Fri, 13 Feb 2015 05:43:40 +0100 (CET) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 34FA926537B for ; Fri, 13 Feb 2015 05:43:12 +0100 (CET) Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 13 Feb 2015 13:43:11 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 0AA5651F57; Fri, 13 Feb 2015 13:43:11 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id E7491480A3; Fri, 13 Feb 2015 13:43:10 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id E1F3A48014; Fri, 13 Feb 2015 13:43:10 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id PAZ30042; Fri, 13 Feb 2015 13:43:10 +0900 X-IronPort-AV: E=Sophos;i="5.09,568,1418050800"; d="scan'208";a="179773245" 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; 13 Feb 2015 13:43:10 +0900 Received: from remon.renesas.com (211.11.155.132) by SINPR06MB171.apcprd06.prod.outlook.com (10.242.57.18) with Microsoft SMTP Server (TLS) id 15.1.81.19; Fri, 13 Feb 2015 04:43:08 +0000 Message-ID: <87386a5skg.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") To: Mark Brown In-Reply-To: <874mqq5slj.wl%kuninori.morimoto.gx@renesas.com> References: <874mqq5slj.wl%kuninori.morimoto.gx@renesas.com> Date: Fri, 13 Feb 2015 04:43:08 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: HKXPR03CA0039.apcprd03.prod.outlook.com (10.141.129.29) To SINPR06MB171.apcprd06.prod.outlook.com (10.242.57.18) 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:SINPR06MB171; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:SINPR06MB171; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(42186005)(86362001)(46102003)(33646002)(23726002)(110136001)(53416004)(54356999)(47776003)(77156002)(62966003)(66066001)(50986999)(76176999)(40100003)(122386002)(2950100001)(77096005)(19580405001)(46406003)(83506001)(92566002)(36756003)(50466002)(229853001)(19580395003); DIR:OUT; SFP:1102; SCL:1; SRVR:SINPR06MB171; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:SINPR06MB171; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2015 04:43:08.9947 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SINPR06MB171 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 1/5 v4] 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 --- v3 -> v4 - no change 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 710993b..a760f6e 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); }