diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2016-10-19 03:56:46 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-10-24 18:23:29 +0100 |
commit | b3ca3fbeb229890e8de569d1b34cd46fcb95826c (patch) | |
tree | 3ce069ad57f300b0df1fc8844ddfbeccbe19cd3a /sound/soc/sh/rcar/rsnd.h | |
parent | 0af5c01a79ade438698af683511803fc11291360 (diff) |
ASoC: rsnd: add rsnd_mod_next() for for_each_rsnd_mod_xxx()
Current rsnd driver is using too complex macro for for-loop of each mod.
In order to simplify this issue, this patch adds new rsnd_mod_next()
which is non-macro.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sh/rcar/rsnd.h')
-rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 901095cb5139..d8f81a4e09e3 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -346,6 +346,18 @@ void rsnd_mod_interrupt(struct rsnd_mod *mod, u32 *rsnd_mod_get_status(struct rsnd_dai_stream *io, struct rsnd_mod *mod, enum rsnd_mod_type type); +struct rsnd_mod *rsnd_mod_next(int *iterator, + struct rsnd_dai_stream *io, + enum rsnd_mod_type *array, + int array_size); +#define for_each_rsnd_mod(iterator, pos, io) \ + for (iterator = 0; \ + (pos = rsnd_mod_next(&iterator, io, NULL, 0));) +#define for_each_rsnd_mod_arrays(iterator, pos, io, array, size) \ + for (iterator = 0; \ + (pos = rsnd_mod_next(&iterator, io, array, size));) +#define for_each_rsnd_mod_array(iterator, pos, io, array) \ + for_each_rsnd_mod_arrays(iterator, pos, io, array, ARRAY_SIZE(array)) void rsnd_parse_connect_common(struct rsnd_dai *rdai, struct rsnd_mod* (*mod_get)(struct rsnd_priv *priv, int id), |