From patchwork Tue Mar 24 09:01:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 6077461 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 34F5BBF90F for ; Tue, 24 Mar 2015 09:01:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27E4E20225 for ; Tue, 24 Mar 2015 09:01:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E4C37201FA for ; Tue, 24 Mar 2015 09:01:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1A1E7261546; Tue, 24 Mar 2015 10:01:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 33EA0264F45; Tue, 24 Mar 2015 10:01:22 +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 3B7DB264F45; Tue, 24 Mar 2015 10:01:21 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id 67F9526511F for ; Tue, 24 Mar 2015 10:01:04 +0100 (CET) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie2.idc.renesas.com with ESMTP; 24 Mar 2015 18:01:02 +0900 Received: from relmlac1.idc.renesas.com (relmlac1.idc.renesas.com [10.200.69.21]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id DE3B14D933; Tue, 24 Mar 2015 18:01:02 +0900 (JST) Received: by relmlac1.idc.renesas.com (Postfix, from userid 0) id AA88B8002E; Tue, 24 Mar 2015 18:01:02 +0900 (JST) Received: from relmlac1.idc.renesas.com (localhost [127.0.0.1]) by relmlac1.idc.renesas.com (Postfix) with ESMTP id 816578002D; Tue, 24 Mar 2015 18:01:02 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac1.idc.renesas.com with ESMTP id UAD17432; Tue, 24 Mar 2015 18:01:02 +0900 X-IronPort-AV: E=Sophos;i="5.11,457,1422889200"; d="scan'208";a="183771385" Received: from mail-hk1lp0123.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.123]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 24 Mar 2015 18:01:02 +0900 Received: from morimoto-PC.renesas.com (211.11.155.132) by HKXPR06MB310.apcprd06.prod.outlook.com (10.141.135.152) with Microsoft SMTP Server (TLS) id 15.1.118.21; Tue, 24 Mar 2015 09:01:00 +0000 Message-ID: <87mw323h3p.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Takashi Iwai , Mark Brown In-Reply-To: <87oani3h4x.wl%kuninori.morimoto.gx@renesas.com> References: <87a8z341ao.wl%kuninori.morimoto.gx@renesas.com> <87sicu3j4o.wl%kuninori.morimoto.gx@renesas.com> <87oani3h4x.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Tue, 24 Mar 2015 09:01:00 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: OS2PR01CA0007.jpnprd01.prod.outlook.com (25.161.74.145) To HKXPR06MB310.apcprd06.prod.outlook.com (10.141.135.152) Authentication-Results: suse.de; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB310; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1; SFV:NSPM; SFS:(10019020)(6009001)(86362001)(23726002)(87976001)(46102003)(93886004)(66066001)(33646002)(36756003)(83506001)(47776003)(53416004)(19580405001)(50466002)(229853001)(92566002)(46406003)(2950100001)(122386002)(62966003)(42186005)(76176999)(40100003)(50986999)(54356999)(77156002)(19580395003)(77096005); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB310; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(5002010); SRVR:HKXPR06MB310; BCL:0; PCL:0; RULEID:; SRVR:HKXPR06MB310; X-Forefront-PRVS: 0525BB0ADF X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2015 09:01:00.8814 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB310 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: soc-core: initialize debugfs in snd_soc_instantiate_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 Current soc_init_card_debugfs() is called from snd_soc_register_card() but, soc_cleanup_card_debugfs() is called from soc_cleanup_card_resources(), not from paired function. This differences don't matter for now. But if anyone wants to implement a proper hotplug/unplug, this difference would become clearer. Now, we can assume that snd_soc_instantiate_card() and soc_cleanup_card_resources() are paired function. soc_init_card_debugfs() / soc_cleanup_card_debugfs() paired function should be called from these. Signed-off-by: Kuninori Morimoto --- sound/soc/soc-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4c26074..76bfff2 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1690,6 +1690,8 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) mutex_unlock(&card->mutex); mutex_unlock(&client_mutex); + soc_init_card_debugfs(card); + return 0; probe_aux_dev_err: @@ -2381,8 +2383,6 @@ int snd_soc_register_card(struct snd_soc_card *card) snd_soc_initialize_card_lists(card); - soc_init_card_debugfs(card); - card->rtd = devm_kzalloc(card->dev, sizeof(struct snd_soc_pcm_runtime) * (card->num_links + card->num_aux_devs), @@ -2413,7 +2413,7 @@ int snd_soc_register_card(struct snd_soc_card *card) ret = snd_soc_instantiate_card(card); if (ret != 0) - soc_cleanup_card_debugfs(card); + return ret; /* deactivate pins to sleep state */ for (i = 0; i < card->num_rtd; i++) {