Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH] pinctrl: renesas: rzn1: Use for_each_child_of_node_scoped()
@ 2024-05-30  9:19 Geert Uytterhoeven
  2024-05-30  9:26 ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2024-05-30  9:19 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-renesas-soc, linux-gpio, Geert Uytterhoeven

Use the scoped variant of for_each_child_of_node() to simplify the code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
To be queued in renesas-pinctrl for v6.11.

 drivers/pinctrl/renesas/pinctrl-rzn1.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzn1.c b/drivers/pinctrl/renesas/pinctrl-rzn1.c
index e1b4203c66c6f836..39af1fe79c8462eb 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzn1.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzn1.c
@@ -737,13 +737,12 @@ static int rzn1_pinctrl_parse_groups(struct device_node *np,
 
 static int rzn1_pinctrl_count_function_groups(struct device_node *np)
 {
-	struct device_node *child;
 	int count = 0;
 
 	if (of_property_count_u32_elems(np, RZN1_PINS_PROP) > 0)
 		count++;
 
-	for_each_child_of_node(np, child) {
+	for_each_child_of_node_scoped(np, child) {
 		if (of_property_count_u32_elems(child, RZN1_PINS_PROP) > 0)
 			count++;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-07 12:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30  9:19 [PATCH] pinctrl: renesas: rzn1: Use for_each_child_of_node_scoped() Geert Uytterhoeven
2024-05-30  9:26 ` Andy Shevchenko
2024-05-30 11:52   ` Geert Uytterhoeven
2024-05-30 13:36     ` Andy Shevchenko
2024-05-31  8:01       ` Dan Carpenter
2024-05-31  8:19         ` Andy Shevchenko
2024-05-31  9:18           ` Dan Carpenter
2024-06-07 12:08         ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox