Skip to content

Commit

Permalink
ASoC: simple-card: use common for_each_child_of_node() for loop
Browse files Browse the repository at this point in the history
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Aug 29, 2014
1 parent a5960bd commit a44a750
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sound/soc/generic/simple-card.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,9 @@ static int asoc_simple_card_parse_of(struct device_node *node,

if (multi) {
struct device_node *np = NULL;
int i;
for (i = 0; (np = of_get_next_child(node, np)); i++) {
int i = 0;

for_each_child_of_node(node, np) {
dev_dbg(dev, "\tlink %d:\n", i);
ret = asoc_simple_card_dai_link_of(np, dev,
dai_link + i,
Expand All @@ -357,6 +358,7 @@ static int asoc_simple_card_parse_of(struct device_node *node,
of_node_put(np);
return ret;
}
i++;
}
} else {
ret = asoc_simple_card_dai_link_of(node, dev,
Expand Down

0 comments on commit a44a750

Please sign in to comment.