diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2018-09-03 05:12:40 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-09-04 18:59:11 +0300 |
commit | 3db769f17714ae65f2faf44ff2bae9d52f4bd46b (patch) | |
tree | 006474c276d60c9d5c5b515487dac83ce28b0977 /include/sound | |
parent | 18d545bb2599d6e5b0747351eaeebb0160d261f9 (diff) | |
download | linux-3db769f17714ae65f2faf44ff2bae9d52f4bd46b.tar.xz |
ASoC: add for_each_link_codecs() macro
ALSA SoC snd_soc_dai_link has snd_soc_dai_link_component array
for codecs.
To be more readable code, this patch adds
new for_each_link_codecs() macro, and replace existing code to it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound')
-rw-r--r-- | include/sound/soc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h index 96c19aabf21b..ce42c578fe82 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -978,6 +978,10 @@ struct snd_soc_dai_link { struct list_head list; /* DAI link list of the soc card */ struct snd_soc_dobj dobj; /* For topology */ }; +#define for_each_link_codecs(link, i, codec) \ + for ((i) = 0; \ + ((i) < link->num_codecs) && ((codec) = &link->codecs[i]); \ + (i)++) struct snd_soc_codec_conf { /* |