Commit a44a750e authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown

ASoC: simple-card: use common for_each_child_of_node() for loop

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a5960bd5
...@@ -346,8 +346,9 @@ static int asoc_simple_card_parse_of(struct device_node *node, ...@@ -346,8 +346,9 @@ static int asoc_simple_card_parse_of(struct device_node *node,
if (multi) { if (multi) {
struct device_node *np = NULL; struct device_node *np = NULL;
int i; int i = 0;
for (i = 0; (np = of_get_next_child(node, np)); i++) {
for_each_child_of_node(node, np) {
dev_dbg(dev, "\tlink %d:\n", i); dev_dbg(dev, "\tlink %d:\n", i);
ret = asoc_simple_card_dai_link_of(np, dev, ret = asoc_simple_card_dai_link_of(np, dev,
dai_link + i, dai_link + i,
...@@ -357,6 +358,7 @@ static int asoc_simple_card_parse_of(struct device_node *node, ...@@ -357,6 +358,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
of_node_put(np); of_node_put(np);
return ret; return ret;
} }
i++;
} }
} else { } else {
ret = asoc_simple_card_dai_link_of(node, dev, ret = asoc_simple_card_dai_link_of(node, dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment