From: Kuninori Morimoto Date: Thu, 28 Aug 2014 03:08:47 +0000 (-0700) Subject: ASoC: simple-card: use common for_each_child_of_node() for loop X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a44a750e5299fe2ece5aa68e8562dd6e2c2b16f4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ASoC: simple-card: use common for_each_child_of_node() for loop Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index 89027047364f..fd8b04588948 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -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, @@ -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,