summaryrefslogtreecommitdiff
path: root/sound/soc/meson
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-08-08 08:54:44 +0300
committerMark Brown <broonie@kernel.org>2019-08-09 20:13:58 +0300
commitc2b71c71037bea7765aa6ff37824520d19108769 (patch)
tree38f96c77c57dd99f53dcee439b04cadf55ea3fb3 /sound/soc/meson
parentb812cd5864548bd9718879896fdd2822d3cb3d76 (diff)
downloadlinux-c2b71c71037bea7765aa6ff37824520d19108769.tar.xz
ASoC: soc-core: add for_each_xxx macro for aux_dev
To be more readable code, this patch adds new for_each_xxx() macro for aux_dev. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87ftmc6w8s.wl-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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/soc/meson/axg-card.c b/sound/soc/meson/axg-card.c
index 6283e5025548..1f698adde506 100644
--- a/sound/soc/meson/axg-card.c
+++ b/sound/soc/meson/axg-card.c
@@ -111,6 +111,7 @@ 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;
+ struct snd_soc_aux_dev *aux;
int i, j;
if (card->dai_link) {
@@ -123,8 +124,8 @@ static void axg_card_clean_references(struct axg_card *priv)
}
if (card->aux_dev) {
- for (i = 0; i < card->num_aux_devs; i++)
- of_node_put(card->aux_dev[i].dlc.of_node);
+ for_each_card_pre_auxs(card, i, aux)
+ of_node_put(aux->dlc.of_node);
}
kfree(card->dai_link);
@@ -157,7 +158,7 @@ static int axg_card_add_aux_devices(struct snd_soc_card *card)
card->aux_dev = aux;
card->num_aux_devs = num;
- for (i = 0; i < card->num_aux_devs; i++, aux++) {
+ for_each_card_pre_auxs(card, i, aux) {
aux->dlc.of_node =
of_parse_phandle(node, "audio-aux-devs", i);
if (!aux->dlc.of_node)