From patchwork Fri Sep 21 17:14:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 147307 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1065219ljw; Fri, 21 Sep 2018 10:14:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZfF7MzVgjmS3KayUbmnRBEcO7sCvayAaBv8H9yHmiPd1sNp2TWJdvEmmQoap5y5tKIVO6X X-Received: by 2002:a1c:4954:: with SMTP id w81-v6mr7844162wma.132.1537550058359; Fri, 21 Sep 2018 10:14:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537550058; cv=none; d=google.com; s=arc-20160816; b=PtgD1Z4E5gntyBh3GOzOPJkD8fxlmUNVOC1cfv5/iknqqNf23TR9Ty9y/OH8EVpbEc qveREa7sxxqc0gxeQ94H9MipEMvhhEd1Y6eSVKIvK7UiHBPjLMeTwiNxrsYrh/5Ti+Qh BnLRcf6aqy3tNnzzVSqAC4wUVQ7a3BTMrPC/93IBsYo29OYMi2Ou6Z0xmqhVy219c63I mGW2z2AxBl6nhm4dR23O90CH7vUont3yYjLibc3+lbuwAiKxFFz7yXCiWbjefZZXNKDX leTbBqUHOVfWaF0eByZ6fiQOj4iekQoz/J1goqpoFUVI6BiMjzB8OJF4X9GHuVj91aoZ zcIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to; bh=wIzGadSi8WwxW1IHJTPZw1k3xpHjl6WrCwXp/oyJ53A=; b=AEQXiegv/bvD4QWhkEq8DAtY0YoGlD1XExVoF4wHU5pqoMyWsAL+8AmpWS1qRfGx/A vIZMY5DdFbZBJV91jPRLjxEVWju5MoxwFcUfZUYrXiVAsHDD8ZrXdOWwx8WbSUdMkCD7 ctmSuwBrTBG7t2Eaq8LnE1qJxoPQBM+pMdlMk/VOyXX9Fqo/Udy3sE6On3Mf/FuoZa3g X8hkr4R/HgjIc/M5qN9df+PrxMncd10uS5/cBXDZNilMrS3tqH+fEBjYrYHR0l+IeqpT nqXSUvGufG2i793pp50tSP7uJ//45hsyV9MPaP/4DNk1hXHCMlIh2D/hITbZJ/ZxajFR cd0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Hw2TAj9A; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id w15-v6si5938871wmi.54.2018.09.21.10.14.10; Fri, 21 Sep 2018 10:14:18 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Hw2TAj9A; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 8C95F267892; Fri, 21 Sep 2018 19:14:09 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id CCD5026789E; Fri, 21 Sep 2018 19:14:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 8C6F32676A7 for ; Fri, 21 Sep 2018 19:14:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=eJqznDjGdV2077HzLKU+7uIQIcexEd4LeGgjUp1V16s=; b=Hw2TAj9ASl1c umGqRVcNKppIo2ShDJNHgD9SVvh91F8EeTTzV9nW7bsscTQUiAbceZmZ+0XvOBB74AaqUKpO2foez xZ2cTF8DRLDSOuZdJTykRGIOaRzkkVHIuByBZO0sCTKoGw4YnVCu6Ws5F/v54tYLYkRRDgm7W2gL5 OwrEw=; Received: from [209.121.128.187] (helo=finisterre.ee.mobilebroadband) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1g3P0F-0000hV-Kq; Fri, 21 Sep 2018 17:14:03 +0000 Received: by finisterre.ee.mobilebroadband (Postfix, from userid 1000) id B2A0B440078; Fri, 21 Sep 2018 18:14:01 +0100 (BST) From: Mark Brown To: Kuninori Morimoto In-Reply-To: <87bm8r2zy0.wl-kuninori.morimoto.gx@renesas.com> Message-Id: <20180921171401.B2A0B440078@finisterre.ee.mobilebroadband> Date: Fri, 21 Sep 2018 18:14:01 +0100 (BST) Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: add for_each_component_dais() macro" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: add for_each_component_dais() macro has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 15a0c64572463eddf59e80aa643d3a87809a7d9b Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Fri, 21 Sep 2018 05:23:17 +0000 Subject: [PATCH] ASoC: add for_each_component_dais() macro To be more readable code, this patch adds new for_each_component_dais() macro, and replace existing code to it. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- include/sound/soc.h | 5 +++++ sound/soc/soc-core.c | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) -- 2.19.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/include/sound/soc.h b/include/sound/soc.h index 93aa894a57ef..f1dab1f4b194 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -864,6 +864,11 @@ struct snd_soc_component { #endif }; +#define for_each_component_dais(component, dai)\ + list_for_each_entry(dai, &(component)->dai_list, list) +#define for_each_component_dais_safe(component, dai, _dai)\ + list_for_each_entry_safe(dai, _dai, &(component)->dai_list, list) + struct snd_soc_rtdcom_list { struct snd_soc_component *component; struct list_head list; /* rtd::component_list */ diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b9b33c8cac2e..62e8e36062df 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -180,7 +180,7 @@ static int dai_list_show(struct seq_file *m, void *v) mutex_lock(&client_mutex); for_each_component(component) - list_for_each_entry(dai, &component->dai_list, list) + for_each_component_dais(component, dai) seq_printf(m, "%s\n", dai->name); mutex_unlock(&client_mutex); @@ -781,7 +781,7 @@ struct snd_soc_dai *snd_soc_find_dai( for_each_component(component) { if (!snd_soc_is_matching_component(dlc, component)) continue; - list_for_each_entry(dai, &component->dai_list, list) { + for_each_component_dais(component, dai) { if (dlc->dai_name && strcmp(dai->name, dlc->dai_name) && (!dai->driver->name || strcmp(dai->driver->name, dlc->dai_name))) @@ -1312,7 +1312,7 @@ static int soc_probe_component(struct snd_soc_card *card, } } - list_for_each_entry(dai, &component->dai_list, list) { + for_each_component_dais(component, dai) { ret = snd_soc_dapm_new_dai_widgets(dapm, dai); if (ret != 0) { dev_err(component->dev, @@ -2842,7 +2842,7 @@ static void snd_soc_unregister_dais(struct snd_soc_component *component) { struct snd_soc_dai *dai, *_dai; - list_for_each_entry_safe(dai, _dai, &component->dai_list, list) { + for_each_component_dais_safe(component, dai, _dai) { dev_dbg(component->dev, "ASoC: Unregistered DAI '%s'\n", dai->name); list_del(&dai->list); @@ -2894,6 +2894,7 @@ static struct snd_soc_dai *soc_add_dai(struct snd_soc_component *component, if (!dai->driver->ops) dai->driver->ops = &null_dai_ops; + /* see for_each_component_dais */ list_add_tail(&dai->list, &component->dai_list); component->num_dai++; @@ -3728,7 +3729,7 @@ int snd_soc_get_dai_name(struct of_phandle_args *args, ret = 0; /* find target DAI */ - list_for_each_entry(dai, &pos->dai_list, list) { + for_each_component_dais(pos, dai) { if (id == 0) break; id--;