]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
pinctrl: renesas: rzn1: Use for_each_child_of_node_scoped()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Thu, 30 May 2024 09:19:29 +0000 (11:19 +0200)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 7 Jun 2024 12:12:10 +0000 (14:12 +0200)
Use the scoped variant of for_each_child_of_node() to simplify the code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/c0a28f466c42d5d59c7fadfa1fd05fd512d43b6f.1717060708.git.geert+renesas@glider.be
drivers/pinctrl/renesas/pinctrl-rzn1.c

index e1b4203c66c6f8360078ba752f1da2b4fea28e20..39af1fe79c8462eb5b781b6ad231d6aacc91d456 100644 (file)
@@ -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++;
        }