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