ASoC: rsnd: move rsnd_mod_call() macro
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 25 Feb 2014 06:14:41 +0000 (22:14 -0800)
committerMark Brown <broonie@linaro.org>
Mon, 3 Mar 2014 01:19:21 +0000 (10:19 +0900)
core.c is the only user of rsnd_mod_call() macro.
Move it to core.c from rsnd.h

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
sound/soc/sh/rcar/core.c
sound/soc/sh/rcar/rsnd.h

index a8e6aa6cb3346d686dd513e1819e8427f97de073..5f6d9fef23d1e61a641b94e31e1f4c549b3a85e7 100644 (file)
@@ -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,
index d4093907dfd86f544d79f4b545cd41ef854ff288..fb1e0cee08b61e7591a90884a824f5047aaeeba1 100644 (file)
@@ -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,