summaryrefslogtreecommitdiffstats
path: root/include/sound/soc.h
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-09-18 01:29:16 +0000
committerMark Brown <broonie@kernel.org>2018-09-20 10:20:02 -0700
commit98061fdbfccc02aa0fd6637c67a0524aab385b8d (patch)
treecc32efa84f2e26e1a579606af9e314614d630c0a /include/sound/soc.h
parent7fe072b4df5d0cc832eb758c1eed243c145a2dfc (diff)
downloadlinux-98061fdbfccc02aa0fd6637c67a0524aab385b8d.tar.bz2
ASoC: add for_each_card_links() macro
To be more readable code, this patch adds new for_each_card_links() 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/soc.h')
-rw-r--r--include/sound/soc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index f94b989e7a1a..1fffbaa819d9 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -1125,6 +1125,12 @@ struct snd_soc_card {
((i) < (card)->num_links) && ((link) = &(card)->dai_link[i]); \
(i)++)
+#define for_each_card_links(card, link) \
+ list_for_each_entry(dai_link, &(card)->dai_link_list, list)
+#define for_each_card_links_safe(card, link, _link) \
+ list_for_each_entry_safe(link, _link, &(card)->dai_link_list, list)
+
+
/* SoC machine DAI configuration, glues a codec and cpu DAI together */
struct snd_soc_pcm_runtime {
struct device *dev;