From patchwork Wed Aug 7 01:29:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11079757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F042A1398 for ; Wed, 7 Aug 2019 01:31:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBA4E2887B for ; Wed, 7 Aug 2019 01:31:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9CFC2888B; Wed, 7 Aug 2019 01:31:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2392F2887B for ; Wed, 7 Aug 2019 01:31:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 746F615E5; Wed, 7 Aug 2019 03:30:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 746F615E5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141489; bh=LKiKCGBAXTcNLURYkIOllT9/CqmukshNaBvoB2v3Hh0=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=I8DAqPIAWUGIuSImFJbhYbsdgUsKu1OLS4xgvWM6xnJPFto9e2EBCwcG4QA39DBTa mGY8zXC6Rz2o32V5eubEZL2+FePv22hLidVmCTOb+Yr0Es2KU9NGsNWQMPxfpB9Pqc 0c45IIMPndesH3KsmY4UaSaW7BW5GEPo2E6VzNW4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 64B4BF80529; Wed, 7 Aug 2019 03:30:05 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8AC25F80533; Wed, 7 Aug 2019 03:30:03 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id DEFCDF804CB for ; Wed, 7 Aug 2019 03:29:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DEFCDF804CB Date: 07 Aug 2019 10:29:56 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23298745" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 07 Aug 2019 10:29:56 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id CDF97413C308; Wed, 7 Aug 2019 10:29:56 +0900 (JST) Message-ID: <87o911ahqh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 01/25] ASoC: soc-core: use device_register() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto It is easy to read code if it is cleanly using paired function/naming, like start <-> stop, register <-> unregister, etc, etc. But, current ALSA SoC code is very random, unbalance, not paired, etc. soc-core.c is using device_unregiser(), but there is no its paired device_regiser(). We can find its code at soc_post_component_init() which is using device_initialize() and device_add(). Here, device_initialize() + device_add() = device_register(). device_initialize() is doing each dev member's initialization only. So, the timing is not important here. let's use device_register() instead of device_initialize()/device_add(). Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 0f75dac..40bac40 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1336,7 +1336,6 @@ static int soc_post_component_init(struct snd_soc_pcm_runtime *rtd, rtd->dev = kzalloc(sizeof(struct device), GFP_KERNEL); if (!rtd->dev) return -ENOMEM; - device_initialize(rtd->dev); rtd->dev->parent = rtd->card->dev; rtd->dev->release = rtd_release; rtd->dev->groups = soc_dev_attr_groups; @@ -1347,7 +1346,7 @@ static int soc_post_component_init(struct snd_soc_pcm_runtime *rtd, INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_CAPTURE].be_clients); INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_PLAYBACK].fe_clients); INIT_LIST_HEAD(&rtd->dpcm[SNDRV_PCM_STREAM_CAPTURE].fe_clients); - ret = device_add(rtd->dev); + ret = device_register(rtd->dev); if (ret < 0) { /* calling put_device() here to free the rtd->dev */ put_device(rtd->dev); From patchwork Wed Aug 7 01:30:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11079759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DFB01398 for ; Wed, 7 Aug 2019 01:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C41C2887B for ; Wed, 7 Aug 2019 01:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 508DB2888B; Wed, 7 Aug 2019 01:32:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B90412887B for ; Wed, 7 Aug 2019 01:32:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2828C1669; Wed, 7 Aug 2019 03:31:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2828C1669 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141536; bh=fCh6wfS8RUE2oNPGzNRbSXT5vCvd1bQVzSQRQfO+2HM=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CuMUiFEZtuvYtcsfWlIr42DudbWjHXmeAgnl9OKbD+ZT8d969zoS5K7mu7tBPTaQl DDBjTkO229rP6jhXFL3cvWUxl0MTmfIRr/zd8EIY9zKVyEjFT9hA89MeEY65EsI2rH I+n4SNIKTcuoyoNR29+eVYW861Q4nGEdA4T/eEUk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 391F4F8053B; Wed, 7 Aug 2019 03:30:21 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5201FF8059F; Wed, 7 Aug 2019 03:30:20 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 2DCFAF80535 for ; Wed, 7 Aug 2019 03:30:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2DCFAF80535 Date: 07 Aug 2019 10:30:13 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518563" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:30:13 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id B53804009669; Wed, 7 Aug 2019 10:30:13 +0900 (JST) Message-ID: <87muglahq0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 02/25] ASoC: soc-core: set component->debugfs_root NULL X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto To be more safety code, let's set NULL to component->debugfs_root when it was cleanuped. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 40bac40..00887f7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -171,7 +171,10 @@ static void soc_init_component_debugfs(struct snd_soc_component *component) static void soc_cleanup_component_debugfs(struct snd_soc_component *component) { + if (!component->debugfs_root) + return; debugfs_remove_recursive(component->debugfs_root); + component->debugfs_root = NULL; } static int dai_list_show(struct seq_file *m, void *v) From patchwork Wed Aug 7 01:30:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11079761 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1D5E1398 for ; Wed, 7 Aug 2019 01:33:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0BA22887B for ; Wed, 7 Aug 2019 01:33:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C515B28913; Wed, 7 Aug 2019 01:33:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 155882887B for ; Wed, 7 Aug 2019 01:33:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 408FD83B; Wed, 7 Aug 2019 03:32:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 408FD83B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141585; bh=IaXwZlVdinxLN78M4Js4AUzBDgZ15BP0/73RQNm19dM=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=K0YWEh4zVterB+1SeNnTx4KXb55TBxCAIKY+9QFfwC4DEvDFtkZDt+4LUloSF9XSQ s1fBvSkEjbiO1O8m0NTHS4uuFvA1zOQX5+uXMVU7V2pOyUkRgNxny26n4Drq2Ty6mb MYwDhwytMLiTOFjakJOw/qZ0cLaCfl+SN36YqbYA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 290BFF805A1; Wed, 7 Aug 2019 03:30:39 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1DE5CF805A9; Wed, 7 Aug 2019 03:30:37 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 0508BF800F3 for ; Wed, 7 Aug 2019 03:30:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0508BF800F3 Date: 07 Aug 2019 10:30:31 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518615" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:30:31 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 2A7FD4009430; Wed, 7 Aug 2019 10:30:31 +0900 (JST) Message-ID: <87lfw5ahpj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 03/25] ASoC: soc-core: add comment for for_each_xxx X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto soc-core has many for_each_xxx, but it is a little bit difficult to know which list is relead to which for_each_xxx. This patch adds missing comment for it. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 00887f7..c46a617 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -380,6 +380,7 @@ static void soc_free_pcm_runtime(struct snd_soc_pcm_runtime *rtd) static void soc_add_pcm_runtime(struct snd_soc_card *card, struct snd_soc_pcm_runtime *rtd) { + /* see for_each_card_rtds */ list_add_tail(&rtd->list, &card->rtd_list); rtd->num = card->num_rtd; card->num_rtd++; @@ -1149,6 +1150,7 @@ int snd_soc_add_dai_link(struct snd_soc_card *card, if (dai_link->dobj.type && card->add_dai_link) card->add_dai_link(card, dai_link); + /* see for_each_card_links */ list_add_tail(&dai_link->list, &card->dai_link_list); return 0; From patchwork Wed Aug 7 01:30:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11079773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7A3541398 for ; Wed, 7 Aug 2019 01:33:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6887D2887D for ; Wed, 7 Aug 2019 01:33:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D11E28981; Wed, 7 Aug 2019 01:33:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B856528958 for ; Wed, 7 Aug 2019 01:33:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3628B857; Wed, 7 Aug 2019 03:33:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3628B857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141634; bh=ojpgKQqp8wwmDqfsHXksbmWhxQIt0o7QjAzb50Ww2Fs=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=s3LGtHwy2SU2UprU4cNiyrxpOXidpDRWvXTObXu3ewh0JPms0t0rHG40MwNAyY5rU xn5WIMZ4mhcN5gdiAtefsEvlZuuDWVq7dPh+REe3idRouc6BGI4EPIBMTG904CDjbI Frd0djnjR7N0Om7NbeCH5yDgppVXU1d8ZTBeP70E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D58DBF805F9; Wed, 7 Aug 2019 03:30:42 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D5A3F805FA; Wed, 7 Aug 2019 03:30:41 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 03A75F80483 for ; Wed, 7 Aug 2019 03:30:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 03A75F80483 Date: 07 Aug 2019 10:30:36 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518636" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:30:36 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 91E7D4009660; Wed, 7 Aug 2019 10:30:36 +0900 (JST) Message-ID: <87k1bpahpd.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 04/25] ASoC: soc-core: check return value of snd_soc_add_dai_link() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_add_dai_link() might return error, we need to check it. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c46a617..315c80d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1963,8 +1963,11 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) } /* add predefined DAI links to the list */ - for_each_card_prelinks(card, i, dai_link) - snd_soc_add_dai_link(card, dai_link); + for_each_card_prelinks(card, i, dai_link) { + ret = snd_soc_add_dai_link(card, dai_link); + if (ret < 0) + goto probe_end; + } /* card bind complete so register a sound card */ ret = snd_card_new(card->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, From patchwork Wed Aug 7 01:30:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11079823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D5631709 for ; Wed, 7 Aug 2019 01:34:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C5EA2887B for ; Wed, 7 Aug 2019 01:34:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 500372887D; Wed, 7 Aug 2019 01:34:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A84BC2887B for ; Wed, 7 Aug 2019 01:34:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2E7BE1660; Wed, 7 Aug 2019 03:33:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2E7BE1660 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141659; bh=xzBqbooB+qiiVx6VNw+fHJ7UdUlXSTLeYr2Rjhp0E+g=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SlGUzYjitEzZLTesQyfzlVJvy1OpPwSV/bVBE+1VYZp9GuZD5WUMpzca8e0CcG4qf Y8bcz8L+PM5GxPRIf1wCU64i+Y7TnZ6p7xed5LimdeICJdFxVGHew8IPZ1AZg2Pab3 xG10jJ++lNSrv0OwCSan3ccxpfTSRHIR1cAvXCHA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DD192F8060E; Wed, 7 Aug 2019 03:30:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E36D0F80611; Wed, 7 Aug 2019 03:30:45 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id D2130F80483 for ; Wed, 7 Aug 2019 03:30:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D2130F80483 Date: 07 Aug 2019 10:30:41 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518643" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:30:41 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 6531E4009660; Wed, 7 Aug 2019 10:30:41 +0900 (JST) Message-ID: <87imr9ahp9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 05/25] ASoC: soc-core: don't use for_each_card_links_safe() at snd_soc_find_dai_link() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto It doesn't removes list during loop at snd_soc_find_dai_link(). We don't need to use _safe loop. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 315c80d..05e8df2 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -817,11 +817,11 @@ struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, int id, const char *name, const char *stream_name) { - struct snd_soc_dai_link *link, *_link; + struct snd_soc_dai_link *link; lockdep_assert_held(&client_mutex); - for_each_card_links_safe(card, link, _link) { + for_each_card_links(card, link) { if (link->id != id) continue; From patchwork Wed Aug 7 01:30:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11079893 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C4D813AC for ; Wed, 7 Aug 2019 01:34:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B6F826E73 for ; Wed, 7 Aug 2019 01:34:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FA9E2887B; Wed, 7 Aug 2019 01:34:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8C57B2887D for ; Wed, 7 Aug 2019 01:34:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0BA73166E; Wed, 7 Aug 2019 03:34:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0BA73166E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141695; bh=s1JBCFau5BTLvk1zPqsOA4tf4M/mZ7LhHzXng70I7dQ=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Va2sg5ZQm3lyH6UZqjWe83o00G7lXxFUkMjg4YVRozEp9nClUYZwR6ZWrPY+3X1F/ lclkOrXszUvnMpIseNsNplbR4g4ujwoI/1s/pnghIkRqUfKYR+hqD791BWTX4lfKwq avLoaVP6vkVUg6fisTkXXZr4W6N5ERj2RISoV0yE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E4C3AF80635; Wed, 7 Aug 2019 03:30:51 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id DDC44F80636; Wed, 7 Aug 2019 03:30:50 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 055C7F80611 for ; Wed, 7 Aug 2019 03:30:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 055C7F80611 Date: 07 Aug 2019 10:30:47 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518657" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:30:47 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 93D444009430; Wed, 7 Aug 2019 10:30:47 +0900 (JST) Message-ID: <87h86tahp2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 06/25] ASoC: soc-core: reuse rtdcom at snd_soc_rtdcom_add() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_rtdcom_add() is using both "rtdcom" and "new_rtdcom" as variable name, but these are not used at same time. Let's reuse rtdcom. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 05e8df2..6347d65 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -274,7 +274,6 @@ static int snd_soc_rtdcom_add(struct snd_soc_pcm_runtime *rtd, struct snd_soc_component *component) { struct snd_soc_rtdcom_list *rtdcom; - struct snd_soc_rtdcom_list *new_rtdcom; for_each_rtdcom(rtd, rtdcom) { /* already connected */ @@ -282,14 +281,14 @@ static int snd_soc_rtdcom_add(struct snd_soc_pcm_runtime *rtd, return 0; } - new_rtdcom = kmalloc(sizeof(*new_rtdcom), GFP_KERNEL); - if (!new_rtdcom) + rtdcom = kmalloc(sizeof(*rtdcom), GFP_KERNEL); + if (!rtdcom) return -ENOMEM; - new_rtdcom->component = component; - INIT_LIST_HEAD(&new_rtdcom->list); + rtdcom->component = component; + INIT_LIST_HEAD(&rtdcom->list); - list_add_tail(&new_rtdcom->list, &rtd->component_list); + list_add_tail(&rtdcom->list, &rtd->component_list); return 0; } From patchwork Wed Aug 7 01:30:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 583C81709 for ; Wed, 7 Aug 2019 01:35:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 471231FE8A for ; Wed, 7 Aug 2019 01:35:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BA5E2018E; Wed, 7 Aug 2019 01:35:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C46D27CEE for ; Wed, 7 Aug 2019 01:35:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D4E1B1664; Wed, 7 Aug 2019 03:34:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D4E1B1664 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141741; bh=FEUxPb8zg9nRKKSWQY1H4VPEcfeYJjfcSftLTBCWOtM=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=X08MEK55/ezI0P/jY1oCRk+j684wb10PPgYWjZ+GVw3bt73vHTpKPqXqEncdPmgyR 4OtbV6NzErr3s0AAmvPGJsJjaPyJkK886PhjMkEggjASSoZzJuTjeXxzZsA70vL2Gb t5Z3JJAp3L/maH3IK6gvWRA+eUwA3XfuCUNNJl50= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BA117F8063A; Wed, 7 Aug 2019 03:30:59 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3A939F8063B; Wed, 7 Aug 2019 03:30:58 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 01743F80636 for ; Wed, 7 Aug 2019 03:30:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 01743F80636 Date: 07 Aug 2019 10:30:53 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518670" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:30:53 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 843DF4009668; Wed, 7 Aug 2019 10:30:53 +0900 (JST) Message-ID: <87ftmdahow.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 07/25] ASoC: soc-core: tidyup for snd_soc_dapm_new_controls() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_dapm_new_controls() registers controls by using for(... i < num; ...). It means if widget was NULL, num should be zero. Thus, we don't need to check about widget pointer. This patch also cares missing return value. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - check return value - change Subject sound/soc/soc-core.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6347d65..b3979bb 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1264,16 +1264,14 @@ static int soc_probe_component(struct snd_soc_card *card, soc_init_component_debugfs(component); - if (component->driver->dapm_widgets) { - ret = snd_soc_dapm_new_controls(dapm, + ret = snd_soc_dapm_new_controls(dapm, component->driver->dapm_widgets, component->driver->num_dapm_widgets); - if (ret != 0) { - dev_err(component->dev, - "Failed to create new controls %d\n", ret); - goto err_probe; - } + if (ret != 0) { + dev_err(component->dev, + "Failed to create new controls %d\n", ret); + goto err_probe; } for_each_component_dais(component, dai) { @@ -1989,13 +1987,15 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) INIT_WORK(&card->deferred_resume_work, soc_resume_deferred); #endif - if (card->dapm_widgets) - snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, - card->num_dapm_widgets); + ret = snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, + card->num_dapm_widgets); + if (ret < 0) + goto probe_end; - if (card->of_dapm_widgets) - snd_soc_dapm_new_controls(&card->dapm, card->of_dapm_widgets, - card->num_of_dapm_widgets); + ret = snd_soc_dapm_new_controls(&card->dapm, card->of_dapm_widgets, + card->num_of_dapm_widgets); + if (ret < 0) + goto probe_end; /* initialise the sound card only once */ if (card->probe) { From patchwork Wed Aug 7 01:30:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 14C191399 for ; Wed, 7 Aug 2019 01:36:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03CF628837 for ; Wed, 7 Aug 2019 01:36:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC9EB2888B; Wed, 7 Aug 2019 01:36:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5ED8D28893 for ; Wed, 7 Aug 2019 01:36:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A407C1666; Wed, 7 Aug 2019 03:35:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A407C1666 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141788; bh=dqYBwhrE2qIK0LNTawfOiEBUg438nyrDar8rnZQemSI=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=l222FjGRmJmOvisJ0tx7i3nsTsbZuNsxX+oid312jrJOoKq3dmDRmAfrBKLFqR5Fk 5rz+IINodLkjYRsMoDJpG+BtafNggSaS2ZVED91XheL5E5zFPZrvYix2YHiTouINJ+ OX173HgcqQ+LY1bku983nk5Jfh3ngT13ueoanmKo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D2FE9F80642; Wed, 7 Aug 2019 03:31:05 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8CF3BF80642; Wed, 7 Aug 2019 03:31:04 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 3B07CF8063E for ; Wed, 7 Aug 2019 03:30:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3B07CF8063E Date: 07 Aug 2019 10:30:58 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23298933" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 07 Aug 2019 10:30:58 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id C4ACB400966A; Wed, 7 Aug 2019 10:30:58 +0900 (JST) Message-ID: <87ef1xahor.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 08/25] ASoC: soc-core: tidyup for snd_soc_add_component_controls() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_add_component_controls() registers controls by using for(... i < num; ...). If controls was NULL, num should be zero. Thus, we don't need to check about controls pointer. This patch also cares missing return value. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - check return value - change Subject sound/soc/soc-core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b3979bb..21cdd3c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1304,10 +1304,12 @@ static int soc_probe_component(struct snd_soc_card *card, } } - if (component->driver->controls) - snd_soc_add_component_controls(component, - component->driver->controls, - component->driver->num_controls); + ret = snd_soc_add_component_controls(component, + component->driver->controls, + component->driver->num_controls); + if (ret < 0) + goto err_probe; + if (component->driver->dapm_routes) snd_soc_dapm_add_routes(dapm, component->driver->dapm_routes, From patchwork Wed Aug 7 01:31:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E979C1399 for ; Wed, 7 Aug 2019 01:37:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8A8E2887D for ; Wed, 7 Aug 2019 01:37:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CABA22891F; Wed, 7 Aug 2019 01:37:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2EE7C2887D for ; Wed, 7 Aug 2019 01:37:00 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8AE3C950; Wed, 7 Aug 2019 03:36:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8AE3C950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141818; bh=lbQVNA2cDxC61R+ovAFbMwJS0Ds59Ts4LTLMqpbYTbs=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XKvI8utqMOvLpf0O0YvFCwKLBppWzFVkDL6672HL9Qxa2Sg6x2sTBG+e9hHQMP4tw fTPcxjchxpUzxtUvdjvj6FFjtsAldxTtDCZvNWVvoFFC6HDpfH9aelhM1vS9VoYmwk xg/gR5vooRgyNv07SJLmv/QIx1DytnYzHvSLeFME= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0AD26F80659; Wed, 7 Aug 2019 03:31:11 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 38E79F8065B; Wed, 7 Aug 2019 03:31:09 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id B594EF8063D for ; Wed, 7 Aug 2019 03:31:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B594EF8063D Date: 07 Aug 2019 10:31:03 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518693" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:03 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 518094009669; Wed, 7 Aug 2019 10:31:03 +0900 (JST) Message-ID: <87d0hhahon.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 09/25] ASoC: soc-core: tidyup for snd_soc_dapm_add_routes() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_dapm_add_routes() registers routes by using for(... i < num; ...). If routes was NULL, num should be zero. Thus, we don't need to check about route pointer. This patch also cares missing return value. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - check return value - change Subject sound/soc/soc-core.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 21cdd3c..ca1b04c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1310,10 +1310,11 @@ static int soc_probe_component(struct snd_soc_card *card, if (ret < 0) goto err_probe; - if (component->driver->dapm_routes) - snd_soc_dapm_add_routes(dapm, - component->driver->dapm_routes, - component->driver->num_dapm_routes); + ret = snd_soc_dapm_add_routes(dapm, + component->driver->dapm_routes, + component->driver->num_dapm_routes); + if (ret < 0) + goto err_probe; list_add(&dapm->list, &card->dapm_list); /* see for_each_card_components */ @@ -2060,13 +2061,15 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) snd_soc_add_card_controls(card, card->controls, card->num_controls); - if (card->dapm_routes) - snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, - card->num_dapm_routes); + ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, + card->num_dapm_routes); + if (ret < 0) + goto probe_end; - if (card->of_dapm_routes) - snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, - card->num_of_dapm_routes); + ret = snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes, + card->num_of_dapm_routes); + if (ret < 0) + goto probe_end; /* try to set some sane longname if DMI is available */ snd_soc_set_dmi_name(card, NULL); From patchwork Wed Aug 7 01:31:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 723381399 for ; Wed, 7 Aug 2019 01:37:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 616C42887D for ; Wed, 7 Aug 2019 01:37:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55F9528893; Wed, 7 Aug 2019 01:37:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF1492887D for ; Wed, 7 Aug 2019 01:37:36 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 30F18165F; Wed, 7 Aug 2019 03:36:45 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 30F18165F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141855; bh=rvguM+SeJUr+bZNIJFengjiM2yZwd7/AqJe/s9ApcGA=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=REkCBPjpvX8VdAGWY99bjRWGzci5JbFV6NdZ5Sam4FnyMtD5DKVHhqsjTqNzcNT6I LOU19DBeMF7DnYzD4rG2fr4+VHS8G57pnnNWqjtqjcvY+fz0eF0JD0OQF6tMfBDdmN 1MsObnJ42jQ90Feb/2pDLV1BGxXj/rVQdsCu3eVU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0484BF80671; Wed, 7 Aug 2019 03:31:15 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 54AACF80672; Wed, 7 Aug 2019 03:31:13 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id F29EBF8063D for ; Wed, 7 Aug 2019 03:31:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F29EBF8063D Date: 07 Aug 2019 10:31:08 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518707" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:08 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 726984009430; Wed, 7 Aug 2019 10:31:08 +0900 (JST) Message-ID: <87blx1ahoi.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 10/25] ASoC: soc-core: tidyup for snd_soc_add_card_controls() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_add_card_controls() registers controls by using for(... i < num; ...). If controls was NULL, num should be zero. Thus, we don't need to check about controls pointer. This patch also cares missing return value. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - check return value - change Subject sound/soc/soc-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index ca1b04c..e939544 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2057,9 +2057,10 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) snd_soc_dapm_link_dai_widgets(card); snd_soc_dapm_connect_dai_link_widgets(card); - if (card->controls) - snd_soc_add_card_controls(card, card->controls, - card->num_controls); + ret = snd_soc_add_card_controls(card, card->controls, + card->num_controls); + if (ret < 0) + goto probe_end; ret = snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, card->num_dapm_routes); From patchwork Wed Aug 7 01:31:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39B931399 for ; Wed, 7 Aug 2019 01:38:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27E7B2887D for ; Wed, 7 Aug 2019 01:38:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AB222892B; Wed, 7 Aug 2019 01:38:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 61AF52887D for ; Wed, 7 Aug 2019 01:38:18 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CF4B21665; Wed, 7 Aug 2019 03:37:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CF4B21665 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141896; bh=LPXhOp0aq8dp72S6NdMJePA1pIZcJtyZNIgpB+Nxo44=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=dmr2F2SRPnnoKIMbd3+61iyW31uQkitm55pK/zx3ILcMUclN6S9LZ1FbqtGYwUZ8G zZITcTdewCO44Udpk6wm1l+cl/lG9LvRHtH4+Q5NOsTSCRA/E/ZiRbu1M0SxkIy+eL wylmZfyA8kECE7BlWzoYbd0R2Zrwp5/0tIDdIL/w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 21686F80677; Wed, 7 Aug 2019 03:31:21 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 83410F80677; Wed, 7 Aug 2019 03:31:19 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 432CEF80675 for ; Wed, 7 Aug 2019 03:31:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 432CEF80675 Date: 07 Aug 2019 10:31:14 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518722" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:14 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D02E34009668; Wed, 7 Aug 2019 10:31:14 +0900 (JST) Message-ID: <87a7clahob.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 11/25] ASoC: soc-core: call snd_soc_dapm_debugfs_init() at soc_init_card_debugfs() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto We have 2 soc_init_card_debugfs() implementations for with/without DEBUG_FS. But, snd_soc_instantiate_card() calls snd_soc_dapm_debugfs_init() under ifdef DEBUG_FS after soc_init_card_debugfs(). This is very strange. We can call snd_soc_dapm_debugfs_init() under soc_init_card_debugfs(). #ifdef CONFIG_DEBUG_FS => static void soc_init_card_debugfs(...) { ... } ... #else => static inline void soc_init_card_debugfs(...) { ... } #endif static int snd_soc_instantiate_card(struct snd_soc_card *card) { ... => soc_init_card_debugfs(card); * #ifdef CONFIG_DEBUG_FS * snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root); * #endif } Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e939544..eb4a247 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -216,6 +216,8 @@ static void soc_init_card_debugfs(struct snd_soc_card *card) debugfs_create_u32("dapm_pop_time", 0644, card->debugfs_card_root, &card->pop_time); + + snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root); } static void soc_cleanup_card_debugfs(struct snd_soc_card *card) @@ -1981,10 +1983,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) soc_init_card_debugfs(card); -#ifdef CONFIG_DEBUG_FS - snd_soc_dapm_debugfs_init(&card->dapm, card->debugfs_card_root); -#endif - #ifdef CONFIG_PM_SLEEP /* deferred resume work */ INIT_WORK(&card->deferred_resume_work, soc_resume_deferred); From patchwork Wed Aug 7 01:31:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E7601399 for ; Wed, 7 Aug 2019 01:39:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D22E28837 for ; Wed, 7 Aug 2019 01:39:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41C292887D; Wed, 7 Aug 2019 01:39:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A862928068 for ; Wed, 7 Aug 2019 01:39:10 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 242FA166E; Wed, 7 Aug 2019 03:38:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 242FA166E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141949; bh=1HbLTDbmNtH+apYtVcWfZozOR9Lsu22DZhxBJCmgftY=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=rsUUkqTypb4nZK5nbihbSkE3cqwV2O1+OWQ3o8hPtL53pbL8jmxjbTBT1ZpH3+wo6 /ngYzqLH2LBM28IOZ3cKb4bclc0LhSi/RZSEHDqiwBl+hS9w0ZeFKCqXXiY3NvqEi3 sdE1nvhmJTh1qj5eo3bMqyky3CUDX2KAdPageeA8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id BF5E8F80676; Wed, 7 Aug 2019 03:31:25 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id C9BB8F806ED; Wed, 7 Aug 2019 03:31:23 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 0DB55F80676 for ; Wed, 7 Aug 2019 03:31:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0DB55F80676 Date: 07 Aug 2019 10:31:19 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518735" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:19 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 9C839413C316; Wed, 7 Aug 2019 10:31:19 +0900 (JST) Message-ID: <878ss5aho6.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 12/25] ASoC: soc-core: remove unneeded list_empty() check for snd_soc_try_rebind_card() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto list_for_each_entry_safe() will do nothing if it was empty list. This patch removes unneeded list_empty() check for list_for_each_entry_safe(). Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index eb4a247..5f23207 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2807,12 +2807,9 @@ static void snd_soc_try_rebind_card(void) { struct snd_soc_card *card, *c; - if (!list_empty(&unbind_card_list)) { - list_for_each_entry_safe(card, c, &unbind_card_list, list) { - if (!snd_soc_bind_card(card)) - list_del(&card->list); - } - } + list_for_each_entry_safe(card, c, &unbind_card_list, list) + if (!snd_soc_bind_card(card)) + list_del(&card->list); } int snd_soc_add_component(struct device *dev, From patchwork Wed Aug 7 01:31:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080491 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3298C1399 for ; Wed, 7 Aug 2019 01:39:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2031F28068 for ; Wed, 7 Aug 2019 01:39:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 146F72887D; Wed, 7 Aug 2019 01:39:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6F6A128068 for ; Wed, 7 Aug 2019 01:39:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D81EC165D; Wed, 7 Aug 2019 03:38:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D81EC165D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565141989; bh=vGmHw/c5MBtWqu9JBSXRZwaZaxCrTWknmDaCaZyDScA=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=JXQ1rUDriKfICq7BlTmMj+TVi3RrOuIJ9cEqYEsn/sXJOPwM690XzEPXhd4oSy1fQ bkZdhhQV/3L8RkVitZ5b3+/6kPeBR1G7c2yCE0F5OOuU4D6EM/0rDSxCbdvgdpTUEl ySFxCe6PqqLLnsJf70RAnLUc+fl2OkA8/NTqUHHU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 077B7F8053A; Wed, 7 Aug 2019 03:31:31 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id C2A8CF806F5; Wed, 7 Aug 2019 03:31:28 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id E8C20F806E9 for ; Wed, 7 Aug 2019 03:31:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E8C20F806E9 Date: 07 Aug 2019 10:31:24 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518745" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:24 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 834ED413C316; Wed, 7 Aug 2019 10:31:24 +0900 (JST) Message-ID: <877e7paho1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 13/25] ASoC: soc-core: tidyup for card->deferred_resume_work X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto card->deferred_resume_work is used if CONFIG_PM_SLEEP was defined. but 1) It is defined even though CONFIG_PM_SLEEP was not defined 2) random ifdef code is difficult to read. This patch tidyup these issues. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - fixup typo at git-log include/sound/soc.h | 5 +++-- sound/soc/soc-core.c | 14 ++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 6ac6481..85ad971 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1058,8 +1058,6 @@ struct snd_soc_card { int num_of_dapm_routes; bool fully_routed; - struct work_struct deferred_resume_work; - /* lists of probed devices belonging to this card */ struct list_head component_dev_list; struct list_head list; @@ -1080,6 +1078,9 @@ struct snd_soc_card { #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_card_root; #endif +#ifdef CONFIG_PM_SLEEP + struct work_struct deferred_resume_work; +#endif u32 pop_time; void *drvdata; diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 5f23207..93de95d 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -701,9 +701,18 @@ int snd_soc_resume(struct device *dev) return 0; } EXPORT_SYMBOL_GPL(snd_soc_resume); + +static void soc_resume_init(struct snd_soc_card *card) +{ + /* deferred resume work */ + INIT_WORK(&card->deferred_resume_work, soc_resume_deferred); +} #else #define snd_soc_suspend NULL #define snd_soc_resume NULL +static inline void soc_resume_init(struct snd_soc_card *card) +{ +} #endif static const struct snd_soc_dai_ops null_dai_ops = { @@ -1983,10 +1992,7 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) soc_init_card_debugfs(card); -#ifdef CONFIG_PM_SLEEP - /* deferred resume work */ - INIT_WORK(&card->deferred_resume_work, soc_resume_deferred); -#endif + soc_resume_init(card); ret = snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets, card->num_dapm_widgets); From patchwork Wed Aug 7 01:31:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080751 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 78CF11399 for ; Wed, 7 Aug 2019 01:42:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6655728875 for ; Wed, 7 Aug 2019 01:42:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AE1628893; Wed, 7 Aug 2019 01:42:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF0AB28875 for ; Wed, 7 Aug 2019 01:42:27 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2B4E21671; Wed, 7 Aug 2019 03:41:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2B4E21671 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142146; bh=8U+w+5H/DUzTNQ1Np6TbLRzuO1jvRB/KPOWKWJjFVto=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MHjHpqaiJDE6ySY1DdwaVCYIrO3cH/yiujNi541tq4t94HtxQ4nZueL603eVi+S1e 4Hsg8K/rrt2+Mk9Ghotv9B7K9lLb3CZJj6h7ykEOQmE7RIzfsDJ7ronpsR/aV7Fkhd AM0fPjhjJWSs0Kh/s7C8P4Bp4cWnBsvDrOVcwUqs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3CE98F80720; Wed, 7 Aug 2019 03:31:52 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 237B2F80717; Wed, 7 Aug 2019 03:31:50 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id D8F11F806F5 for ; Wed, 7 Aug 2019 03:31:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D8F11F806F5 Date: 07 Aug 2019 10:31:31 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23299008" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:31 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 3EF2C413D104; Wed, 7 Aug 2019 10:31:31 +0900 (JST) Message-ID: <875zn9ahnv.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 14/25] ASoC: soc-core: define soc_dpcm_debugfs_add() for non CONFIG_DEBUG_FS X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto soc_dpcm_debugfs_add() is implemented at soc-pcm.c under CONFIG_DEBUG_FS. Thus, soc-core.c which is only user of it need to use CONFIG_DEBUG_FS, too. This patch defines soc_dpcm_debugfs_add() for non CONFIG_DEBUG_FS case. Then, we can remove #ifdef CONFIG_DEBUG_FS from soc-core.c Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change include/sound/soc-dpcm.h | 9 ++++++++- sound/soc/soc-core.c | 2 -- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h index 4be3a2b..e55aeb0 100644 --- a/include/sound/soc-dpcm.h +++ b/include/sound/soc-dpcm.h @@ -142,9 +142,16 @@ void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream, /* internal use only */ int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); -void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); int soc_dpcm_runtime_update(struct snd_soc_card *); +#ifdef CONFIG_DEBUG_FS +void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); +#else +static inline void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd) +{ +} +#endif + int dpcm_path_get(struct snd_soc_pcm_runtime *fe, int stream, struct snd_soc_dapm_widget_list **list_); int dpcm_process_paths(struct snd_soc_pcm_runtime *fe, diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 93de95d..d95259c 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1486,11 +1486,9 @@ static int soc_probe_link_dais(struct snd_soc_card *card, if (ret) return ret; -#ifdef CONFIG_DEBUG_FS /* add DPCM sysfs entries */ if (dai_link->dynamic) soc_dpcm_debugfs_add(rtd); -#endif num = rtd->num; From patchwork Wed Aug 7 01:31:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080549 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9A9A1399 for ; Wed, 7 Aug 2019 01:40:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D85B628837 for ; Wed, 7 Aug 2019 01:40:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCEBB2888B; Wed, 7 Aug 2019 01:40:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 342E728837 for ; Wed, 7 Aug 2019 01:40:22 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AA043166B; Wed, 7 Aug 2019 03:39:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AA043166B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142020; bh=6VN2kdMFwMCzNE61GfWRplIuwPWddItrbGYmmyVBryw=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ML+t/NnEqdaNEBKuy7hID7nPrbmG3YgCGlhY0naDYVDKW2zNP97giqToo4OwsUOgB FfGBtNe0/Etsm8OeK1PCf6gDJiNPbor2KII738clC1Fc0A5p2reMJe9tF7606bZ157 7NmekcQLPe9H4zvadQbT/ZuNPGNfQunJlIn9wAOQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0498EF806F8; Wed, 7 Aug 2019 03:31:42 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2579DF80709; Wed, 7 Aug 2019 03:31:40 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 69280F806F0 for ; Wed, 7 Aug 2019 03:31:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 69280F806F0 Date: 07 Aug 2019 10:31:36 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518765" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:36 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 30E2A413D743; Wed, 7 Aug 2019 10:31:36 +0900 (JST) Message-ID: <874l2tahnq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 15/25] ASoC: soc-core: dai_link check under soc_dpcm_debugfs_add() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto soc_dpcm_debugfs_add(rtd) is checking rtd->dai_link pointer, but, rtd->dai_link->dynamic have been already checked before calling it. static int soc_probe_link_dais(...) { dai_link = rtd->dai_link; ... => if (dai_link->dynamic) => soc_dpcm_debugfs_add(rtd); ... } void soc_dpcm_debugfs_add(rtd) { => if (!rtd->dai_link) return; ... } These pointer checks are strange/pointless. This patch checks dai_link->dynamic under soc_dpcm_debugfs_add(). Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 3 +-- sound/soc/soc-pcm.c | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d95259c..665223f 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1487,8 +1487,7 @@ static int soc_probe_link_dais(struct snd_soc_card *card, return ret; /* add DPCM sysfs entries */ - if (dai_link->dynamic) - soc_dpcm_debugfs_add(rtd); + soc_dpcm_debugfs_add(rtd); num = rtd->num; diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 77c986f..da657c8 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -3200,6 +3200,9 @@ void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd) if (!rtd->dai_link) return; + if (!rtd->dai_link->dynamic) + return; + if (!rtd->card->debugfs_card_root) return; From patchwork Wed Aug 7 01:31:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080617 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 307441399 for ; Wed, 7 Aug 2019 01:41:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D1612845C for ; Wed, 7 Aug 2019 01:41:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 10A2F2851B; Wed, 7 Aug 2019 01:41:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4DF272845C for ; Wed, 7 Aug 2019 01:41:02 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BEA4C1666; Wed, 7 Aug 2019 03:40:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BEA4C1666 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142060; bh=4Sfr869JOKRPkEyboD+9OZKPbrW+XiTuGM3xRA6xwxg=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cfnUhs5egBMQtpTC6GFiH6lv7NnX5lyTsp9k1TyfaVU7k+yDe0qzzqoDGfek9XH4f SpqV6aRZVuSd/WMmy4boPQeDUUprGo9OhDuFno0/ysN12VZ48Or7hyQxkgSk9ESp2F xpDWDEjjsEzjT+wCxL8Z5zM6zPrgjKaFk3BS/gBE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 01F14F80713; Wed, 7 Aug 2019 03:31:47 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2CDF7F80713; Wed, 7 Aug 2019 03:31:45 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id B6009F8070D for ; Wed, 7 Aug 2019 03:31:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B6009F8070D Date: 07 Aug 2019 10:31:40 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23299021" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:40 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 886C94009668; Wed, 7 Aug 2019 10:31:40 +0900 (JST) Message-ID: <8736idahnl.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 16/25] ASoC: soc-core: merge snd_soc_initialize_card_lists() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_initialize_card_lists() is doing card related INIT_LIST_HEAD(), but, it is already doing at snd_soc_register_card(). We don't need to do it separately. This patch merges these. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change include/sound/soc.h | 10 ---------- sound/soc/soc-core.c | 13 ++++++++----- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 85ad971..c92697e 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1210,16 +1210,6 @@ static inline void *snd_soc_card_get_drvdata(struct snd_soc_card *card) return card->drvdata; } -static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card) -{ - INIT_LIST_HEAD(&card->widgets); - INIT_LIST_HEAD(&card->paths); - INIT_LIST_HEAD(&card->dapm_list); - INIT_LIST_HEAD(&card->aux_comp_list); - INIT_LIST_HEAD(&card->component_dev_list); - INIT_LIST_HEAD(&card->list); -} - static inline bool snd_soc_volsw_is_stereo(struct soc_mixer_control *mc) { if (mc->reg == mc->rreg && mc->shift == mc->rshift) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 665223f..b631ab5 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2389,15 +2389,18 @@ int snd_soc_register_card(struct snd_soc_card *card) dev_set_drvdata(card->dev, card); - snd_soc_initialize_card_lists(card); - + INIT_LIST_HEAD(&card->widgets); + INIT_LIST_HEAD(&card->paths); + INIT_LIST_HEAD(&card->dapm_list); + INIT_LIST_HEAD(&card->aux_comp_list); + INIT_LIST_HEAD(&card->component_dev_list); + INIT_LIST_HEAD(&card->list); INIT_LIST_HEAD(&card->dai_link_list); - INIT_LIST_HEAD(&card->rtd_list); - card->num_rtd = 0; - INIT_LIST_HEAD(&card->dapm_dirty); INIT_LIST_HEAD(&card->dobj_list); + + card->num_rtd = 0; card->instantiated = 0; mutex_init(&card->mutex); mutex_init(&card->dapm_mutex); From patchwork Wed Aug 7 01:31:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080687 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D15C61709 for ; Wed, 7 Aug 2019 01:41:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFB1828875 for ; Wed, 7 Aug 2019 01:41:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B43012887D; Wed, 7 Aug 2019 01:41:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 251C728893 for ; Wed, 7 Aug 2019 01:41:47 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8BAA0166A; Wed, 7 Aug 2019 03:40:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8BAA0166A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142105; bh=6GtWqffrZ7apAboDw7zlwDaK6RjivEZ3fMwP4f68+Bk=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nyn7WCkeM6i35Iy8XD2IzvTELveiBeN5i0AWiUhTbY5z6dKD4m8J4mSUDJGbL2K9b y+WEnqc9OmXVp+JVKU/K+B+iuFOSTfj6vzzT/G0MesS55H/PKtLdSsVzhsLVbxc21p SgV29/OfQVkjhU4ZC4owNubV3fojPzpp4d6060SM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 57718F80715; Wed, 7 Aug 2019 03:31:50 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 60C0CF8071C; Wed, 7 Aug 2019 03:31:49 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 203F6F80709 for ; Wed, 7 Aug 2019 03:31:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 203F6F80709 Date: 07 Aug 2019 10:31:44 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23299027" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:44 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id ACE0E4009668; Wed, 7 Aug 2019 10:31:44 +0900 (JST) Message-ID: <871rxxahnh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 17/25] ASoC: soc-core: remove unneeded dai_link check from snd_soc_remove_dai_link() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_remove_dai_link() has card connected dai_link check. but 1) we need to call list_del() anyway, because it is "remove" function, 2) It is doing many thing for this card / dai_link already before checking dai_link. This patch removes poinless dai_link check Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b631ab5..421a908 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1180,8 +1180,6 @@ EXPORT_SYMBOL_GPL(snd_soc_add_dai_link); void snd_soc_remove_dai_link(struct snd_soc_card *card, struct snd_soc_dai_link *dai_link) { - struct snd_soc_dai_link *link, *_link; - if (dai_link->dobj.type && dai_link->dobj.type != SND_SOC_DOBJ_DAI_LINK) { dev_err(card->dev, "Invalid dai link type %d\n", @@ -1197,12 +1195,7 @@ void snd_soc_remove_dai_link(struct snd_soc_card *card, if (dai_link->dobj.type && card->remove_dai_link) card->remove_dai_link(card, dai_link); - for_each_card_links_safe(card, link, _link) { - if (link == dai_link) { - list_del(&link->list); - return; - } - } + list_del(&dai_link->list); } EXPORT_SYMBOL_GPL(snd_soc_remove_dai_link); From patchwork Wed Aug 7 01:31:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DB1C13AC for ; Wed, 7 Aug 2019 01:43:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BFBD28875 for ; Wed, 7 Aug 2019 01:43:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 005F72888B; Wed, 7 Aug 2019 01:43:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9FC4428875 for ; Wed, 7 Aug 2019 01:42:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0F5BE1669; Wed, 7 Aug 2019 03:42:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0F5BE1669 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142178; bh=EL5iTwDMhJQyzn6brG9hx1OnjcnnBauoHZKklmmR2Yo=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FDdCXxOqvKM7Q2GfiVLKC+Sk/7qipD+bJWFF3Tyc4hbjAApm3Plg4QJExF6yzlFUg +QfQwKIp0xiJpRtbr11rxmYqxrR8EISxT5aI9HwA27GoY7tYZwNMvmjovo28n2jgBB dhnuyYPyhgtEQ+3yXYj+AxBRK9UYLnhHZVUTEkO8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6D965F80735; Wed, 7 Aug 2019 03:31:56 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 969CEF8072C; Wed, 7 Aug 2019 03:31:55 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id D6EDEF8072C for ; Wed, 7 Aug 2019 03:31:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D6EDEF8072C Date: 07 Aug 2019 10:31:49 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518783" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:49 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 7FD0A4009669; Wed, 7 Aug 2019 10:31:49 +0900 (JST) Message-ID: <87zhkl932w.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 18/25] ASoC: soc-core: add NOTE to snd_soc_rtdcom_lookup() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto We can find specified name component via snd_soc_rtdcom_lookup(). But, it is not enough under multi CPU/Codec/Platform, because many components which have same driver name might be connected to same rtd. Not using this function as much as possible is best solution, but some drivers are already deeply depended to it. We can expand this function, for example having "num" which specifies found order at parameter, etc (In such case, it need to have fixed probing order). Or, use different driver name in such component, etc. We will have such issue if multi CPU/Codec/Platform were supported. To indicate it, this patch adds NOTE to this function. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 421a908..80703618 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -313,6 +313,14 @@ struct snd_soc_component *snd_soc_rtdcom_lookup(struct snd_soc_pcm_runtime *rtd, if (!driver_name) return NULL; + /* + * NOTE + * + * snd_soc_rtdcom_lookup() will find component from rtd by using + * specified driver name. + * But, if many components which have same driver name are connected + * to 1 rtd, this function will return 1st found component. + */ for_each_rtdcom(rtd, rtdcom) { const char *component_name = rtdcom->component->driver->name; From patchwork Wed Aug 7 01:31:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 720B613AC for ; Wed, 7 Aug 2019 01:43:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DD7828875 for ; Wed, 7 Aug 2019 01:43:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F4552888B; Wed, 7 Aug 2019 01:43:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD60528875 for ; Wed, 7 Aug 2019 01:43:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 3AB811672; Wed, 7 Aug 2019 03:42:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3AB811672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142218; bh=MSBXhZyxZ+04gAiYp8V1Q4nRDKueFNvk4/WHMRme0VM=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TlUJTKQwPK6+g+BSZKsjL6kdZ6rndPTpLo2Ozn6LIn328EmNk++i81jzo0/JeOfPj iEbSYQW6J8Ta9QX46MCE+kwlH8Wh+6ixlF5GzC2YpwKAKXpMcaf8LUs4nMCVd078m/ Z9v7Jk6My/XzFQbDuD0awIb8bUR9l/8q0fnA/mkU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8BB84F80746; Wed, 7 Aug 2019 03:31:58 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id CCFE4F8074B; Wed, 7 Aug 2019 03:31:57 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 2EAC6F80733 for ; Wed, 7 Aug 2019 03:31:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2EAC6F80733 Date: 07 Aug 2019 10:31:53 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518791" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:53 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id BA7EA4009430; Wed, 7 Aug 2019 10:31:53 +0900 (JST) Message-ID: <87y305932s.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 19/25] ASoC: soc-core: don't call snd_soc_component_set_jack() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto snd_soc_component_set_jack() is used for both setting/clearing. Setting purpose is used under each driver. Hence, clearing purpose should be used under each driver, not soc-core. soc-core shouldn't touch it even though its purpose was for clearing, otherwise, code becomes very confusable. This patch removes snd_soc_component_set_jack() from soc-core.c Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 80703618..e708095 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -938,7 +938,6 @@ static int soc_bind_dai_link(struct snd_soc_card *card, static void soc_cleanup_component(struct snd_soc_component *component) { - snd_soc_component_set_jack(component, NULL, NULL); list_del(&component->card_list); snd_soc_dapm_free(snd_soc_component_get_dapm(component)); soc_cleanup_component_debugfs(component); From patchwork Wed Aug 7 01:31:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080883 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF2B413AC for ; Wed, 7 Aug 2019 01:44:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDCC028875 for ; Wed, 7 Aug 2019 01:44:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C26602888B; Wed, 7 Aug 2019 01:44:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2AF732887D for ; Wed, 7 Aug 2019 01:44:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A3B211682; Wed, 7 Aug 2019 03:43:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A3B211682 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142268; bh=32Uo+F7V9fUfEYrVAAY4DDFc0EedqTyqs+GwalHRs8w=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=P61ZlmFZCpfw275/oJ6JD6wumHITwMWp59MXbWZdsqhkfWymWUYy57bvloVT8LFar HSeuEUnrvnBisoCEHFNaF+zRF5D4Z6jL1Aa/3TyegrGl6PQ3cPcGQ1G0W/5X2TiTT2 x/mz1j7ZFmpxlUNXQgsuCa4FQ4NL+GYCc4ADwyc0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5F9F4F8075E; Wed, 7 Aug 2019 03:32:04 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB726F80760; Wed, 7 Aug 2019 03:32:02 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id B178BF80753 for ; Wed, 7 Aug 2019 03:31:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B178BF80753 Date: 07 Aug 2019 10:31:58 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518800" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:31:58 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 408EB413D774; Wed, 7 Aug 2019 10:31:58 +0900 (JST) Message-ID: <87wofp932o.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 20/25] ASoC: soc-core: don't alloc memory carelessly when creating debugfs X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Current ALSA SoC might allocate debugfs name memory via kasprintf(), but, it is unnecessary and the code becoming very complex. Using local variable with appropriate size is enough. This patch uses 64byte local variable for it. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - fixup typo at git-log sound/soc/soc-core.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e708095..203e7cf 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -147,23 +147,19 @@ static const struct attribute_group *soc_dev_attr_groups[] = { #ifdef CONFIG_DEBUG_FS static void soc_init_component_debugfs(struct snd_soc_component *component) { + char name[64]; + if (!component->card->debugfs_card_root) return; - if (component->debugfs_prefix) { - char *name; - - name = kasprintf(GFP_KERNEL, "%s:%s", + if (component->debugfs_prefix) + snprintf(name, ARRAY_SIZE(name), "%s:%s", component->debugfs_prefix, component->name); - if (name) { - component->debugfs_root = debugfs_create_dir(name, - component->card->debugfs_card_root); - kfree(name); - } - } else { - component->debugfs_root = debugfs_create_dir(component->name, - component->card->debugfs_card_root); - } + else + snprintf(name, ARRAY_SIZE(name), "%s", component->name); + + component->debugfs_root = debugfs_create_dir(name, + component->card->debugfs_card_root); snd_soc_dapm_debugfs_init(snd_soc_component_get_dapm(component), component->debugfs_root); From patchwork Wed Aug 7 01:32:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080891 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBF5E13A4 for ; Wed, 7 Aug 2019 01:45:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9C7C28875 for ; Wed, 7 Aug 2019 01:45:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D3BA2888B; Wed, 7 Aug 2019 01:45:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1021A28875 for ; Wed, 7 Aug 2019 01:45:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8C608167A; Wed, 7 Aug 2019 03:44:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8C608167A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142309; bh=GU0BcQjhmZ+ty8+K0qMWKxj+5GuId4Jo4lQ/t/p/U2Q=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OpLuhTlCJA1dV+0MtZ/GR5v83QudS2WbE3+NIhRwOOr6CxHMIoKZGR5sPXhdkEtkr hi3X4bcJ4t7a9ID9uqF9sZRQ26sbSd1+z5hKc3AprqZxWZJhx6W2FPQIQiUkoV910A i25kqO18NUWovQrSnWJkt0zlBJsf/Rh54P9pgSUM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 935F2F80768; Wed, 7 Aug 2019 03:32:09 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1F453F80769; Wed, 7 Aug 2019 03:32:07 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 73DD1F80760 for ; Wed, 7 Aug 2019 03:32:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 73DD1F80760 Date: 07 Aug 2019 10:32:03 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518814" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:32:03 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 07946413DADD; Wed, 7 Aug 2019 10:32:03 +0900 (JST) Message-ID: <87v9v9932j.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 21/25] ASoC: soc-core: soc_cleanup_card_resources() become void X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto There is no need to check return value for soc_cleanup_card_resources(). Let't makes it as void. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 203e7cf..cf8763e 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1901,7 +1901,7 @@ static void soc_check_tplg_fes(struct snd_soc_card *card) } } -static int soc_cleanup_card_resources(struct snd_soc_card *card) +static void soc_cleanup_card_resources(struct snd_soc_card *card) { /* free the ALSA card at first; this syncs with pending operations */ if (card->snd_card) { @@ -1922,8 +1922,6 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card) /* remove the card */ if (card->remove) card->remove(card); - - return 0; } static int snd_soc_instantiate_card(struct snd_soc_card *card) From patchwork Wed Aug 7 01:32:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06C5513A4 for ; Wed, 7 Aug 2019 01:45:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC706262FF for ; Wed, 7 Aug 2019 01:45:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB719285A8; Wed, 7 Aug 2019 01:45:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3703C262FF for ; Wed, 7 Aug 2019 01:45:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8B8FA847; Wed, 7 Aug 2019 03:44:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8B8FA847 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142347; bh=WmvNp2A1FzDp9a5g/831U+uCBPlmQF89MH4+HasatTs=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=pnOqDUmbkTcI8CpP9X0ON9Vs5I9pgI6sfJtaB+lqqq2KmTkUjrLtyK1IWsMSQHvp9 EL1S1dxv246iurzCxqFVCyFYYaLixLoVvyT4JDiw8tpJCZhqZW/6O9ChsSVKdVK0mD 8ZeRQ+p1MLYvwl8F3TxktuwYp9amPa30xrxya+Oc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E2CE5F80534; Wed, 7 Aug 2019 03:32:16 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id ACF9CF8076F; Wed, 7 Aug 2019 03:32:14 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 2374AF8076A for ; Wed, 7 Aug 2019 03:32:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2374AF8076A Date: 07 Aug 2019 10:32:09 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518825" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:32:09 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id AEA184009669; Wed, 7 Aug 2019 10:32:09 +0900 (JST) Message-ID: <87tvat932c.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 22/25] ASoC: soc-core: initialize component list X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto It might return without initializing in error case. In such case, uninitialized variable might be used at error handler. This patch initializes all necessary variable before return. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - fixup typo at git-log - removed unneeded component->list initialize 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 cf8763e..41f7976 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2661,6 +2661,9 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, { struct snd_soc_dapm_context *dapm; + INIT_LIST_HEAD(&component->dai_list); + mutex_init(&component->io_mutex); + component->name = fmt_single_name(dev, &component->id); if (!component->name) { dev_err(dev, "ASoC: Failed to allocate name\n"); @@ -2677,9 +2680,6 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, dapm->idle_bias_off = !driver->idle_bias_on; dapm->suspend_bias_off = driver->suspend_bias_off; - INIT_LIST_HEAD(&component->dai_list); - mutex_init(&component->io_mutex); - return 0; } From patchwork Wed Aug 7 01:32:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080897 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 701B013A4 for ; Wed, 7 Aug 2019 01:46:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FB9928875 for ; Wed, 7 Aug 2019 01:46:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 544832888B; Wed, 7 Aug 2019 01:46:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 946712887D for ; Wed, 7 Aug 2019 01:46:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0E62A1670; Wed, 7 Aug 2019 03:45:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E62A1670 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142383; bh=/ot2IaJIGFlhqXDOoZQZgF3zLK2GkhZ5p75rZX3b/Ek=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ApwLBt4nvi1/xuE/GV4HZbw4AKOZN7F0xun08GgT0/kHHr0bSREIFQdEbJffJ9nuV jhMKmeon6KN5DCiSaug4XOLFyCL7qcGhyM8YMyn+amTyoBUBopUnQgr39pIU1XwnrG 6w5mD783akpZyECOQ9FqGj8wQqXWlJOaZsdkEikM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D381AF800F3; Wed, 7 Aug 2019 03:32:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id EDE8DF80771; Wed, 7 Aug 2019 03:32:18 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id A84E8F80533 for ; Wed, 7 Aug 2019 03:32:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A84E8F80533 Date: 07 Aug 2019 10:32:14 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23518836" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 07 Aug 2019 10:32:14 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 348D4413DAE8; Wed, 7 Aug 2019 10:32:14 +0900 (JST) Message-ID: <87sgqd9328.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 23/25] ASoC: soc-core: initialize list at one place X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Initialize component related list at random place is very difficult to read. This patch initialize it at snd_soc_component_initialize(). Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change sound/soc/soc-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 41f7976..e0d427a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1265,7 +1265,6 @@ static int soc_probe_component(struct snd_soc_card *card, component->card = card; dapm->card = card; - INIT_LIST_HEAD(&component->card_list); INIT_LIST_HEAD(&dapm->list); soc_set_name_prefix(card, component); @@ -2662,6 +2661,8 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, struct snd_soc_dapm_context *dapm; INIT_LIST_HEAD(&component->dai_list); + INIT_LIST_HEAD(&component->dobj_list); + INIT_LIST_HEAD(&component->card_list); mutex_init(&component->io_mutex); component->name = fmt_single_name(dev, &component->id); @@ -2747,7 +2748,6 @@ static void snd_soc_component_add(struct snd_soc_component *component) /* see for_each_component */ list_add(&component->list, &component_list); - INIT_LIST_HEAD(&component->dobj_list); mutex_unlock(&client_mutex); } From patchwork Wed Aug 7 01:32:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080899 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3DB331850 for ; Wed, 7 Aug 2019 01:47:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A1AF28875 for ; Wed, 7 Aug 2019 01:47:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A7D82888B; Wed, 7 Aug 2019 01:47:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 626B928875 for ; Wed, 7 Aug 2019 01:47:08 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D046F1686; Wed, 7 Aug 2019 03:46:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D046F1686 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142426; bh=C6rc0mq6pAJn2GPAHp/Wue9M8kgKIMBxpZ5bRIlrJlk=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=LkQHtehOxd6E2qKo3O49a/mJb3PTsug+Pr46aC+trl3cI05ce0yO1k6f8D37QLpJF 05Ru7zUGzm3mpPMW2sFyPfqC5fFo9rU1KeVzonggDJcaaYEs+Hyvsy7tFSCqgMTrM6 PKzdfBWUEaO73iT+WjNY1LhYCotT9iJ6oy9IqKzE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EC94EF80787; Wed, 7 Aug 2019 03:32:27 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BB823F80792; Wed, 7 Aug 2019 03:32:25 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 6E650F8077B for ; Wed, 7 Aug 2019 03:32:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6E650F8077B Date: 07 Aug 2019 10:32:18 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23299099" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 07 Aug 2019 10:32:18 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id ADE2B413DADD; Wed, 7 Aug 2019 10:32:18 +0900 (JST) Message-ID: <87r25x9323.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 24/25] ASoC: soc-dai: use bit field for bus_control X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto .bus_control can be bit field. this patch do it. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - no change include/sound/soc-dai.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index dc48fe0..939c73d 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -293,8 +293,6 @@ struct snd_soc_dai_driver { /* Optional Callback used at pcm creation*/ int (*pcm_new)(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai); - /* DAI is also used for the control bus */ - bool bus_control; /* ops */ const struct snd_soc_dai_ops *ops; @@ -306,6 +304,7 @@ struct snd_soc_dai_driver { unsigned int symmetric_rates:1; unsigned int symmetric_channels:1; unsigned int symmetric_samplebits:1; + unsigned int bus_control:1; /* DAI is also used for the control bus */ /* probe ordering - for components with runtime dependencies */ int probe_order; From patchwork Wed Aug 7 01:32:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11080901 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2553114E5 for ; Wed, 7 Aug 2019 01:47:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11E5A28875 for ; Wed, 7 Aug 2019 01:47:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 029B32888B; Wed, 7 Aug 2019 01:47:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 593BA28875 for ; Wed, 7 Aug 2019 01:47:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C8761950; Wed, 7 Aug 2019 03:46:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C8761950 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1565142467; bh=CHNDHBJKm0CB1LNealNApQ0n6NAdh8l/TzRhZkrWb1A=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=qfuJNrcQWgDAP+7aE+5a3VMhv7K+K715CKOZwKNLAZg6OkSwFp+E4+ZSMtsqDy93a y8eDjggo118gkWQpLzvfXgOPcG4xDjz2hgZLLDwIU0c7CD/kdG9wmxQH9cXCZ2aOOU rHupeNF0D6EHyGpkR812lW2uWCyrGeNdM+9B4KQI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DCEA3F80797; Wed, 7 Aug 2019 03:32:28 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id CDA15F80791; Wed, 7 Aug 2019 03:32:26 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 3D882F8077D for ; Wed, 7 Aug 2019 03:32:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3D882F8077D Date: 07 Aug 2019 10:32:22 +0900 X-IronPort-AV: E=Sophos;i="5.64,353,1559487600"; d="scan'208";a="23299105" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 07 Aug 2019 10:32:22 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 143664009430; Wed, 7 Aug 2019 10:32:22 +0900 (JST) Message-ID: <87pnlh9320.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> References: <87pnlhahr6.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH v2 25/25] ASoC: soc-topology: use for_each_component_dais() at remove_dai() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto commit 52abe6cc1866a ("ASoC: topology: fix oops/use-after-free case with dai driver") fixups remove_dai() error, but it is using list_for_each_entry() for component->dai_list. We already have for_each_component_dais() macro for it. Let's use exising method. Signed-off-by: Kuninori Morimoto Reviewed-by: Ranjani Sridharan --- v1 -> v2 - no change sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index dc463f1..b869071 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -530,7 +530,7 @@ static void remove_dai(struct snd_soc_component *comp, if (dobj->ops && dobj->ops->dai_unload) dobj->ops->dai_unload(comp, dobj); - list_for_each_entry(dai, &comp->dai_list, list) + for_each_component_dais(comp, dai) if (dai->driver == dai_drv) dai->driver = NULL;