Skip to contentSkip to conversation

ALSA: ppc: Switch to use for_each_child_of_node() macro

PATCH Applied Yang Yingliang 2 participants 2 messages Sep 16, 2022 – Sep 17, 2022 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: ppc: Switch to use for_each_child_of_node() macro

Use for_each_child_of_node() macro instead of open coding it. No functional change.

---
 sound/ppc/tumbler.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
sound/ppc/tumbler.c +2 -4
index c65e74d7cd0a..f3f8ad7c3df8 100644
@@ -1060,8 +1060,7 @@ static struct device_node *find_audio_device(const char *name)
 	if (! gpiop)
 		return NULL;
   
-	for (np = of_get_next_child(gpiop, NULL); np;
-			np = of_get_next_child(gpiop, np)) {
+	for_each_child_of_node(gpiop, np) {
 		const char *property = of_get_property(np, "audio-gpio", NULL);
 		if (property && strcmp(property, name) == 0)
 			break;
@@ -1080,8 +1079,7 @@ static struct device_node *find_compatible_audio_device(const char *name)
 	if (!gpiop)
 		return NULL;
   
-	for (np = of_get_next_child(gpiop, NULL); np;
-			np = of_get_next_child(gpiop, np)) {
+	for_each_child_of_node(gpiop, np) {
 		if (of_device_is_compatible(np, name))
 			break;
 	}  
Signature · 1 line
2.25.1