From patchwork Tue Feb 25 06:14: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: 3712841 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CCE599F2ED for ; Tue, 25 Feb 2014 06:16:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C63A201B4 for ; Tue, 25 Feb 2014 06:16:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D60D72016C for ; Tue, 25 Feb 2014 06:16:29 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 04A772655F1; Tue, 25 Feb 2014 07:16:29 +0100 (CET) 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, 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 7FC4B26559B; Tue, 25 Feb 2014 07:15:16 +0100 (CET) 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 635A52655C4; Tue, 25 Feb 2014 07:15:15 +0100 (CET) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by alsa0.perex.cz (Postfix) with ESMTP id 8B5452655AA for ; Tue, 25 Feb 2014 07:14:43 +0100 (CET) Received: by mail-pd0-f181.google.com with SMTP id p10so2893698pdj.26 for ; Mon, 24 Feb 2014 22:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:message-id:from:subject:user-agent:to:cc:in-reply-to :references:mime-version:content-type; bh=V6B1nyAnGZouP+w8dnC/1KnPbwjy1arJdajekXalepk=; b=BdUXEelZevIxZXoGKATOksahq6nFY60AiI54bRyYi4rqa3xKMTVEdPH9ZH2m5+F8A/ TwJJ4ojGyNkledil7YuqPVFt4h5GQrWXG+uY0Z+vMOszSILAxuj03Z1/Rdl4tUCHWu7t 09P5P6XTwD4rELhIFkGszXzDDLY0gJCIHog/LLa9FioYAx6OOfSAYsNi/aohN2grTICL wj7q/pFq7H9j3gwN9n4wzkrqBgEQUmUv4aLlVKufd1oYtTFXHXT0liDY0t81yIyPAczk vLesKcONruQnSO4SQYMbJGO+kFKKPR8bfoegr+WaiZoJnSFDddy0XTqVbJ/etQqhgnZG xVqA== X-Received: by 10.66.146.133 with SMTP id tc5mr29875419pab.58.1393308882621; Mon, 24 Feb 2014 22:14:42 -0800 (PST) Received: from morimoto-Dell-XPS420.gmail.com (49.14.32.202.bf.2iij.net. [202.32.14.49]) by mx.google.com with ESMTPSA id x5sm6475676pbw.26.2014.02.24.22.14.40 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 24 Feb 2014 22:14:41 -0800 (PST) Date: Mon, 24 Feb 2014 22:14:41 -0800 (PST) Message-ID: <87a9df90s1.wl%kuninori.morimoto.gx@gmail.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <87d2ib90t9.wl%kuninori.morimoto.gx@gmail.com> References: <87d2ib90t9.wl%kuninori.morimoto.gx@gmail.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto Subject: [alsa-devel] [PATCH 02/19] ASoC: rsnd: move rsnd_mod_call() macro 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 core.c is the only user of rsnd_mod_call() macro. Move it to core.c from rsnd.h Signed-off-by: Kuninori Morimoto --- sound/soc/sh/rcar/core.c | 34 ++++++++++++++++++++++++---------- sound/soc/sh/rcar/rsnd.h | 13 ------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index a8e6aa6..5f6d9fe 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -291,16 +291,30 @@ void rsnd_dma_quit(struct rsnd_priv *priv, /* * rsnd_dai functions */ -#define rsnd_dai_call(rdai, io, fn) \ -({ \ - struct rsnd_mod *mod, *n; \ - int ret = 0; \ - for_each_rsnd_mod(mod, n, io) { \ - ret = rsnd_mod_call(mod, fn, rdai, io); \ - if (ret < 0) \ - break; \ - } \ - ret; \ +#define __rsnd_mod_call(mod, func, rdai, io) \ +({ \ + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \ + struct device *dev = rsnd_priv_to_dev(priv); \ + dev_dbg(dev, "%s [%d] %s\n", \ + rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \ + (mod)->ops->func(mod, rdai, io); \ +}) + +#define rsnd_mod_call(mod, func, rdai, io) \ + (!(mod) ? -ENODEV : \ + !((mod)->ops->func) ? 0 : \ + __rsnd_mod_call(mod, func, (rdai), (io))) + +#define rsnd_dai_call(rdai, io, fn) \ +({ \ + struct rsnd_mod *mod, *n; \ + int ret = 0; \ + for_each_rsnd_mod(mod, n, (io)) { \ + ret = rsnd_mod_call(mod, fn, (rdai), (io)); \ + if (ret < 0) \ + break; \ + } \ + ret; \ }) int rsnd_dai_connect(struct rsnd_dai *rdai, diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index d409390..fb1e0ce 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -169,19 +169,6 @@ struct rsnd_mod { #define rsnd_mod_id(mod) ((mod)->id) #define for_each_rsnd_mod(pos, n, io) \ list_for_each_entry_safe(pos, n, &(io)->head, list) -#define __rsnd_mod_call(mod, func, rdai, io) \ -({ \ - struct rsnd_priv *priv = rsnd_mod_to_priv(mod); \ - struct device *dev = rsnd_priv_to_dev(priv); \ - dev_dbg(dev, "%s-%d-%s\n", \ - rsnd_mod_name(mod), rsnd_mod_id(mod), #func); \ - (mod)->ops->func(mod, rdai, io); \ -}) - -#define rsnd_mod_call(mod, func, rdai, io) \ - (!(mod) ? -ENODEV : \ - !((mod)->ops->func) ? 0 : \ - __rsnd_mod_call(mod, func, rdai, io)) void rsnd_mod_init(struct rsnd_priv *priv, struct rsnd_mod *mod,