From patchwork Thu Jun 20 00:49:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11005613 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 3CE066C5 for ; Thu, 20 Jun 2019 00:50:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3287828722 for ; Thu, 20 Jun 2019 00:50:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2681F28739; Thu, 20 Jun 2019 00:50:46 +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 6EE8128722 for ; Thu, 20 Jun 2019 00:50:45 +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 CAEBF1686; Thu, 20 Jun 2019 02:49:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CAEBF1686 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560991843; bh=4xIY7EpD6Vt/7/gsabsPxPsUJUh1fdqQtSOx7N0q1kA=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XK6gnsc4QWrCiEAcW4aQNIS2qC7l2dhpE7BmxH4g7hmlqYwcw9JGWwvQN4/nWtWHC iRFqeN13SfRa4apEThrGWSeuzWHQrFzYV944VJAb8kfLbORQYBwXwnVFDLTW/tEi8j W8H0AEVmYl/B3looCpav7yRh3E7xH9iYOUUnCLrM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 780EDF896DF; Thu, 20 Jun 2019 02:49:24 +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 0E8DAF896F9; Thu, 20 Jun 2019 02:49:23 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id AF40CF80CC4 for ; Thu, 20 Jun 2019 02:49:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AF40CF80CC4 Date: 20 Jun 2019 09:49:17 +0900 X-IronPort-AV: E=Sophos;i="5.62,394,1554735600"; d="scan'208";a="18907017" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 20 Jun 2019 09:49:17 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 79BBB411D109; Thu, 20 Jun 2019 09:49:17 +0900 (JST) Message-ID: <87sgs5rsl2.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: <87tvclrslu.wl-kuninori.morimoto.gx@renesas.com> References: <87tvclrslu.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 1/4] ASoC: soc-core: move soc_find_component() 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 move soc_find_component() next to snd_soc_is_matching_component(). This is prepare for soc_find_component() cleanup Signed-off-by: Kuninori Morimoto --- sound/soc/soc-core.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 4cd77cd..1b94119 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -760,6 +760,25 @@ static struct device_node return of_node; } +static int snd_soc_is_matching_component( + const struct snd_soc_dai_link_component *dlc, + struct snd_soc_component *component) +{ + struct device_node *component_of_node; + + if (!dlc) + return 0; + + component_of_node = soc_component_to_node(component); + + if (dlc->of_node && component_of_node != dlc->of_node) + return 0; + if (dlc->name && strcmp(component->name, dlc->name)) + return 0; + + return 1; +} + static struct snd_soc_component *soc_find_component( const struct device_node *of_node, const char *name) { @@ -782,25 +801,6 @@ static struct snd_soc_component *soc_find_component( return NULL; } -static int snd_soc_is_matching_component( - const struct snd_soc_dai_link_component *dlc, - struct snd_soc_component *component) -{ - struct device_node *component_of_node; - - if (!dlc) - return 0; - - component_of_node = soc_component_to_node(component); - - if (dlc->of_node && component_of_node != dlc->of_node) - return 0; - if (dlc->name && strcmp(component->name, dlc->name)) - return 0; - - return 1; -} - /** * snd_soc_find_dai - Find a registered DAI * From patchwork Thu Jun 20 00:49:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11005615 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 8D330112C for ; Thu, 20 Jun 2019 00:51:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 807012878E for ; Thu, 20 Jun 2019 00:51:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72D65288CF; Thu, 20 Jun 2019 00:51: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 CA7652878E for ; Thu, 20 Jun 2019 00:51: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 E79A1166A; Thu, 20 Jun 2019 02:50:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E79A1166A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560991889; bh=litSgzrEAvPSyg1jmrg3FkxOrHaq/8iQgO35XDLGSuM=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OhDA1uuuBlzRBH+CaFCYAtix1LD6V2e3CljqylVqPWWiULL0JRjl8wvxtBg705ONX L734vZX7dcJ+fJlyAjIJAnHry76TMuDB2I5dZ+QaPc1x2qk00jTJ3t7/+Z7vlL/oir 6XdXVoBdl8Gtpg2STm28oHwTIWEMvBIM4dtXDdDI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8996EF89730; Thu, 20 Jun 2019 02:49:29 +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 C395EF89731; Thu, 20 Jun 2019 02:49:27 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id ADFAEF896F9 for ; Thu, 20 Jun 2019 02:49:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ADFAEF896F9 Date: 20 Jun 2019 09:49:23 +0900 X-IronPort-AV: E=Sophos;i="5.62,394,1554735600"; d="scan'208";a="18907030" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 20 Jun 2019 09:49:23 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id CDA27411D111; Thu, 20 Jun 2019 09:49:22 +0900 (JST) Message-ID: <87r27prskw.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: <87tvclrslu.wl-kuninori.morimoto.gx@renesas.com> References: <87tvclrslu.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 2/4] ASoC: soc-core: soc_find_component() uses snd_soc_is_matching_component() 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 ALSA SoC already has snd_soc_is_matching_component() to confirming matching component, but, soc_find_component() has original implementation to confirm component. We shouldn't have duplicate implementation to do same things. This patch uses snd_soc_is_matching_component() at soc_find_component() Signed-off-by: Kuninori Morimoto --- sound/soc/soc-core.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1b94119..e6b95b7 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -780,22 +780,18 @@ static int snd_soc_is_matching_component( } static struct snd_soc_component *soc_find_component( - const struct device_node *of_node, const char *name) + struct device_node *of_node, const char *name) { struct snd_soc_component *component; - struct device_node *component_of_node; + struct snd_soc_dai_link_component dlc; lockdep_assert_held(&client_mutex); for_each_component(component) { - if (of_node) { - component_of_node = soc_component_to_node(component); - - if (component_of_node == of_node) - return component; - } else if (name && strcmp(component->name, name) == 0) { + dlc.name = name; + dlc.of_node = of_node; + if (snd_soc_is_matching_component(&dlc, component)) return component; - } } return NULL; From patchwork Thu Jun 20 00:49:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11005617 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 8E87E112C for ; Thu, 20 Jun 2019 00:52:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82DCE2878E for ; Thu, 20 Jun 2019 00:52:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76F43288CF; Thu, 20 Jun 2019 00:52:16 +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 AEEAE2878E for ; Thu, 20 Jun 2019 00:52:15 +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 0918B168F; Thu, 20 Jun 2019 02:51:24 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0918B168F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560991934; bh=kgcBbyU0xl9+e2m0mRsU972nMHVYg71N0A/+NExQ6ic=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VvlE1u4z3FCcv17HWO2jl4hmZ86pbTBeGQzJ7LrHz0ACe3px4xGqYjb7pTZGoXGy3 66QiikkT7TxCuoiadu4bj2QrBk9/Tz/dJ3vxStQg78uOehcgx2TtlvdyAsTpCZfXfg sSaDnBzadSoPkRQi0NbFwOCRpMFWMRdex76ivR5k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9271AF89736; Thu, 20 Jun 2019 02:49:35 +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 B1E35F89736; Thu, 20 Jun 2019 02:49:33 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 14C03F89733 for ; Thu, 20 Jun 2019 02:49:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 14C03F89733 Date: 20 Jun 2019 09:49:27 +0900 X-IronPort-AV: E=Sophos;i="5.62,394,1554735600"; d="scan'208";a="19115169" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 20 Jun 2019 09:49:27 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 46A68411D109; Thu, 20 Jun 2019 09:49:27 +0900 (JST) Message-ID: <87pnn9rsks.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: <87tvclrslu.wl-kuninori.morimoto.gx@renesas.com> References: <87tvclrslu.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 3/4] ASoC: soc-core: soc_find_component() uses snd_soc_dai_link_component 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_find_component() is using "of_node" and "name" to finding component, but we should use snd_soc_dai_link_component now, because it is created to such purpose. This patch uses snd_soc_dai_link_component for soc_find_component(). Signed-off-by: Kuninori Morimoto --- sound/soc/soc-core.c | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e6b95b7..1749f4a 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -780,19 +780,15 @@ static int snd_soc_is_matching_component( } static struct snd_soc_component *soc_find_component( - struct device_node *of_node, const char *name) + const struct snd_soc_dai_link_component *dlc) { struct snd_soc_component *component; - struct snd_soc_dai_link_component dlc; lockdep_assert_held(&client_mutex); - for_each_component(component) { - dlc.name = name; - dlc.of_node = of_node; - if (snd_soc_is_matching_component(&dlc, component)) + for_each_component(component) + if (snd_soc_is_matching_component(dlc, component)) return component; - } return NULL; } @@ -1106,8 +1102,7 @@ static int soc_init_dai_link(struct snd_soc_card *card, * added to component list. */ if ((link->platforms->of_node || link->platforms->name) && - !soc_find_component(link->platforms->of_node, - link->platforms->name)) + !soc_find_component(link->platforms)) return -EPROBE_DEFER; } @@ -1136,7 +1131,7 @@ static int soc_init_dai_link(struct snd_soc_card *card, * component list. */ if ((link->cpus->of_node || link->cpus->name) && - !soc_find_component(link->cpus->of_node, link->cpus->name)) + !soc_find_component(link->cpus)) return -EPROBE_DEFER; /* @@ -1580,23 +1575,23 @@ static int soc_bind_aux_dev(struct snd_soc_card *card, int num) { struct snd_soc_aux_dev *aux_dev = &card->aux_dev[num]; struct snd_soc_component *component; - const char *name; - struct device_node *codec_of_node; + struct snd_soc_dai_link_component dlc; if (aux_dev->codec_of_node || aux_dev->codec_name) { /* codecs, usually analog devices */ - name = aux_dev->codec_name; - codec_of_node = aux_dev->codec_of_node; - component = soc_find_component(codec_of_node, name); + dlc.name = aux_dev->codec_name; + dlc.of_node = aux_dev->codec_of_node; + component = soc_find_component(&dlc); if (!component) { - if (codec_of_node) - name = of_node_full_name(codec_of_node); + if (dlc.of_node) + dlc.name = of_node_full_name(dlc.of_node); goto err_defer; } } else if (aux_dev->name) { /* generic components */ - name = aux_dev->name; - component = soc_find_component(NULL, name); + dlc.name = aux_dev->name; + dlc.of_node = NULL; + component = soc_find_component(&dlc); if (!component) goto err_defer; } else { @@ -1610,7 +1605,7 @@ static int soc_bind_aux_dev(struct snd_soc_card *card, int num) return 0; err_defer: - dev_err(card->dev, "ASoC: %s not registered\n", name); + dev_err(card->dev, "ASoC: %s not registered\n", dlc.name); return -EPROBE_DEFER; } @@ -3661,11 +3656,11 @@ EXPORT_SYMBOL_GPL(snd_soc_of_parse_daifmt); int snd_soc_get_dai_id(struct device_node *ep) { struct snd_soc_component *component; - struct device_node *node; + struct snd_soc_dai_link_component dlc; int ret; - node = of_graph_get_port_parent(ep); - + dlc.of_node = of_graph_get_port_parent(ep); + dlc.name = NULL; /* * For example HDMI case, HDMI has video/sound port, * but ALSA SoC needs sound port number only. @@ -3674,13 +3669,13 @@ int snd_soc_get_dai_id(struct device_node *ep) */ ret = -ENOTSUPP; mutex_lock(&client_mutex); - component = soc_find_component(node, NULL); + component = soc_find_component(&dlc); if (component && component->driver->of_xlate_dai_id) ret = component->driver->of_xlate_dai_id(component, ep); mutex_unlock(&client_mutex); - of_node_put(node); + of_node_put(dlc.of_node); return ret; } From patchwork Thu Jun 20 00:49:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11005619 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 9CC3E6C5 for ; Thu, 20 Jun 2019 00:52:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9056A2878E for ; Thu, 20 Jun 2019 00:52:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83A26288CF; Thu, 20 Jun 2019 00:52: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 D67472878E for ; Thu, 20 Jun 2019 00:52:48 +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 328A11689; Thu, 20 Jun 2019 02:51:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 328A11689 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560991967; bh=1/t7s8IXBuDGA3QHyGBJ8TPsKX1bXYNNaKjmnsfRN/U=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=M1gGmtYV1BZjEUYYoDTZwATW27w7FoXW8bQywZm9bjPt2hIh4xjnC1p+IkKudyndt K/yKpOxGDpo82ALJsWw5b6gOvWqhSq9uB1JvQr+cbq5Di3sYL7t9LFEghLZwH8JYMu oWjKz5liwhGVsMUnLKDcKKlxcfBkaSWycaalQ9cs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B191FF89739; Thu, 20 Jun 2019 02:49:40 +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 B6981F8973A; Thu, 20 Jun 2019 02:49:38 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 547D6F89732 for ; Thu, 20 Jun 2019 02:49:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 547D6F89732 Date: 20 Jun 2019 09:49:33 +0900 X-IronPort-AV: E=Sophos;i="5.62,394,1554735600"; d="scan'208";a="18907043" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 20 Jun 2019 09:49:33 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 090F5400B9E4; Thu, 20 Jun 2019 09:49:33 +0900 (JST) Message-ID: <87o92trskm.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: <87tvclrslu.wl-kuninori.morimoto.gx@renesas.com> References: <87tvclrslu.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 4/4] ASoC: soc-core: use soc_find_component() at snd_soc_find_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 snd_soc_find_dai() finds component first via specified snd_soc_dai_link_component, and find DAI from it. We already have soc_find_component() to find component, but soc_find_dai() has original implementation to find component. We shouldn't have duplicate implementation to do same things. This patch uses soc_find_component() at soc_find_dai() Signed-off-by: Kuninori Morimoto --- sound/soc/soc-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 1749f4a..358f1fb 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -813,9 +813,8 @@ struct snd_soc_dai *snd_soc_find_dai( lockdep_assert_held(&client_mutex); /* Find CPU DAI from registered DAIs */ - for_each_component(component) { - if (!snd_soc_is_matching_component(dlc, component)) - continue; + component = soc_find_component(dlc); + if (component) { for_each_component_dais(component, dai) { if (dlc->dai_name && strcmp(dai->name, dlc->dai_name) && (!dai->driver->name