diff options
author | Krzysztof Kozlowski <[email protected]> | 2024-08-16 17:31:42 +0200 |
---|---|---|
committer | Lee Jones <[email protected]> | 2024-08-22 14:23:06 +0100 |
commit | 9d4cfee092ecdaf98f255ee61d094334ddf9f110 (patch) | |
tree | 5710f9dccdb84dcbdd79dfecea8f2aec0a46f1f1 | |
parent | 2c37529ee95d06ab44613572bfa474413f9a5b58 (diff) |
leds: lp55xx: Simplify with scoped for each OF child loop
Use scoped for_each_available_child_of_node_scoped() when iterating over
device nodes to make code a bit simpler.
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Lee Jones <[email protected]>
-rw-r--r-- | drivers/leds/leds-lp55xx-common.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index 29e7142dca72..d493b31c215a 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -1173,16 +1173,13 @@ static int lp55xx_parse_multi_led(struct device_node *np, struct lp55xx_led_config *cfg, int child_number) { - struct device_node *child; int num_colors = 0, ret; - for_each_available_child_of_node(np, child) { + for_each_available_child_of_node_scoped(np, child) { ret = lp55xx_parse_multi_led_child(child, cfg, child_number, num_colors); - if (ret) { - of_node_put(child); + if (ret) return ret; - } num_colors++; } |