summaryrefslogtreecommitdiff
path: root/sound/soc/meson
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-09-03 02:12:40 +0000
committerMark Brown <broonie@kernel.org>2018-09-04 16:59:11 +0100
commit3db769f17714ae65f2faf44ff2bae9d52f4bd46b (patch)
tree006474c276d60c9d5c5b515487dac83ce28b0977 /sound/soc/meson
parent18d545bb2599d6e5b0747351eaeebb0160d261f9 (diff)
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 'sound/soc/meson')
-rw-r--r--sound/soc/meson/axg-card.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
index b76a5f4f1785..3e68f1aa68ff 100644
--- a/sound/soc/meson/axg-card.c
+++ b/sound/soc/meson/axg-card.c
@@ -97,14 +97,15 @@ static void axg_card_clean_references(struct axg_card *priv)
{
struct snd_soc_card *card = &priv->card;
struct snd_soc_dai_link *link;
+ struct snd_soc_dai_link_component *codec;
int i, j;
if (card->dai_link) {
for (i = 0; i < card->num_links; i++) {
link = &card->dai_link[i];
of_node_put(link->cpu_of_node);
- for (j = 0; j < link->num_codecs; j++)
- of_node_put(link->codecs[j].of_node);
+ for_each_link_codecs(link, j, codec)
+ of_node_put(codec->of_node);
}
}