From patchwork Fri May 9 00:44:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 4139731 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 566AFBFF02 for ; Fri, 9 May 2014 00:46:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B523202EC for ; Fri, 9 May 2014 00:46:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 670DD202E9 for ; Fri, 9 May 2014 00:46:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7AD082655A7; Fri, 9 May 2014 02:46:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 3BD012655BD; Fri, 9 May 2014 02:45:20 +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 4366D2655BD; Fri, 9 May 2014 02:45:19 +0200 (CEST) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by alsa0.perex.cz (Postfix) with ESMTP id 72982265568 for ; Fri, 9 May 2014 02:44:42 +0200 (CEST) Received: by mail-pa0-f42.google.com with SMTP id rd3so3589163pab.15 for ; Thu, 08 May 2014 17:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:to:cc:in-reply-to:references:subject :user-agent:mime-version:content-type; bh=Z9DXQvt8hajgD1WvrWJqVu4eUi3ifyYespJXPpNqhhY=; b=lJjEfNAob4EaTy+IAloHj/YZi+VZEadPtRf8MymSow7N+cYI5ZKRviaK0L63a159Rk nTN2McHuhD27zSgJbAAAha6VXGLYJEgfdvWco5Cw8dZbYSSfm8+5Wk7uT+saytWO2q2m X1jZBiYbv+kHHX0hEyQ7v9Eg8C6RH27jgYYadC8FOKp3P6kg20YuI6eSaW+TAh15jCMd brNAF5dKisXMGLz7zX9Y4PvIsDRijCAootkeGJn6eB4N5rZvsepnUt7T2J4hLNFyk/FB LHzHEs95m8XCIjqXRMtBTq0uiOZ5dwzOsaACdBECQJwI6b3aOonCaIcgW/KagIGIMHzQ TW1g== X-Received: by 10.66.232.68 with SMTP id tm4mr13893317pac.114.1399596281601; Thu, 08 May 2014 17:44:41 -0700 (PDT) Received: from remon.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id lr3sm134646pab.4.2014.05.08.17.44.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 08 May 2014 17:44:41 -0700 (PDT) Date: Thu, 08 May 2014 17:44:41 -0700 (PDT) Message-ID: <87mweraih5.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto To: Mark Brown In-Reply-To: <87siojaike.wl%kuninori.morimoto.gx@gmail.com> References: <87siojaike.wl%kuninori.morimoto.gx@gmail.com> User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto Subject: [alsa-devel] [PATCH 4/5] ASoC: rsnd: enable to use multi parameter on rsnd_dai_call/rsnd_mod_call X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto rsnd_mod_ops would like to come to use multi parameter. modify macro to enable it. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 86c9b78..378985b 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -338,7 +338,7 @@ u32 rsnd_get_adinr(struct rsnd_mod *mod) /* * rsnd_dai functions */ -#define __rsnd_mod_call(mod, func, rdai) \ +#define __rsnd_mod_call(mod, func, rdai...) \ ({ \ struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \ struct device *dev = rsnd_priv_to_dev(priv); \ @@ -347,12 +347,12 @@ u32 rsnd_get_adinr(struct rsnd_mod *mod) (mod)->ops->func(mod, rdai); \ }) -#define rsnd_mod_call(mod, func, rdai) \ +#define rsnd_mod_call(mod, func, rdai...) \ (!(mod) ? -ENODEV : \ !((mod)->ops->func) ? 0 : \ - __rsnd_mod_call(mod, func, (rdai))) + __rsnd_mod_call(mod, func, rdai)) -#define rsnd_dai_call(rdai, io, fn) \ +#define rsnd_dai_call(fn, io, rdai...) \ ({ \ struct rsnd_mod *mod; \ int ret = 0, i; \ @@ -360,7 +360,7 @@ u32 rsnd_get_adinr(struct rsnd_mod *mod) mod = (io)->mod[i]; \ if (!mod) \ continue; \ - ret = rsnd_mod_call(mod, fn, (rdai)); \ + ret = rsnd_mod_call(mod, fn, rdai); \ if (ret < 0) \ break; \ } \ @@ -510,20 +510,20 @@ static int rsnd_soc_dai_trigger(struct snd_pcm_substream *substream, int cmd, if (ret < 0) goto dai_trigger_end; - ret = rsnd_dai_call(rdai, io, init); + ret = rsnd_dai_call(init, io, rdai); if (ret < 0) goto dai_trigger_end; - ret = rsnd_dai_call(rdai, io, start); + ret = rsnd_dai_call(start, io, rdai); if (ret < 0) goto dai_trigger_end; break; case SNDRV_PCM_TRIGGER_STOP: - ret = rsnd_dai_call(rdai, io, stop); + ret = rsnd_dai_call(stop, io, rdai); if (ret < 0) goto dai_trigger_end; - ret = rsnd_dai_call(rdai, io, quit); + ret = rsnd_dai_call(quit, io, rdai); if (ret < 0) goto dai_trigger_end; @@ -951,11 +951,11 @@ static int rsnd_probe(struct platform_device *pdev) } for_each_rsnd_dai(rdai, priv, i) { - ret = rsnd_dai_call(rdai, &rdai->playback, probe); + ret = rsnd_dai_call(probe, &rdai->playback, rdai); if (ret) return ret; - ret = rsnd_dai_call(rdai, &rdai->capture, probe); + ret = rsnd_dai_call(probe, &rdai->capture, rdai); if (ret) return ret; } @@ -998,11 +998,11 @@ static int rsnd_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); for_each_rsnd_dai(rdai, priv, i) { - ret = rsnd_dai_call(rdai, &rdai->playback, remove); + ret = rsnd_dai_call(remove, &rdai->playback, rdai); if (ret) return ret; - ret = rsnd_dai_call(rdai, &rdai->capture, remove); + ret = rsnd_dai_call(remove, &rdai->capture, rdai); if (ret) return ret; }