Skip to contentSkip to conversation

ALSA: aoa: Use helper function for_each_child_of_node()

PATCH Applied Zhang Zekun 2 participants 2 messages Aug 16, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: aoa: Use helper function for_each_child_of_node()

for_each_child_of_node can help to iterate through the device_node, and we don't need to use while loop. No functional change with this conversion.

---
 sound/aoa/soundbus/i2sbus/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/aoa/soundbus/i2sbus/core.c +2 -2
index 5431d2c49421..ce84288168e4 100644
@@ -335,7 +335,7 @@ static int i2sbus_add_dev(struct macio_dev *macio,
 
 static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match)
 {
-	struct device_node *np = NULL;
+	struct device_node *np;
 	int got = 0, err;
 	struct i2sbus_control *control = NULL;
 
@@ -347,7 +347,7 @@ static int i2sbus_probe(struct macio_dev* dev, const struct of_device_id *match)
 		return -ENODEV;
 	}
 
-	while ((np = of_get_next_child(dev->ofdev.dev.of_node, np))) {
+	for_each_child_of_node(dev->ofdev.dev.of_node, np) {
 		if (of_device_is_compatible(np, "i2sbus") ||
 		    of_device_is_compatible(np, "i2s-modem")) {
 			got += i2sbus_add_dev(dev, control, np);
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 6 lines · Zhang Zekun

for_each_child_of_node can help to iterate through the device_node, and we don't need to use while loop. No functional change with this conversion.

Thanks, applied.

Takashi