diff mbox

[4/4,v2] ASoC: simple-card: use common for_each_child_of_node() for loop

Message ID 87zjepgvk3.wl%kuninori.morimoto.gx@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kuninori Morimoto Aug. 28, 2014, 3:08 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

 - no change

 sound/soc/generic/simple-card.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Mark Brown Aug. 29, 2014, 11:51 a.m. UTC | #1
On Wed, Aug 27, 2014 at 08:08:47PM -0700, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

applied, thanks.
diff mbox

Patch

diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 8902704..fd8b045 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,