Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i3c: master: Simplify with scoped for each OF child loop

Use scoped for-each loop when iterating over device nodes to make code a
bit simpler.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251224124551.208778-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Krzysztof Kozlowski and committed by
Alexandre Belloni
ceff3bc1 3c9ffb4d

+2 -5
+2 -5
drivers/i3c/master.c
··· 2403 2403 { 2404 2404 struct device *dev = &master->dev; 2405 2405 struct device_node *i3cbus_np = dev->of_node; 2406 - struct device_node *node; 2407 2406 int ret; 2408 2407 u32 val; 2409 2408 2410 2409 if (!i3cbus_np) 2411 2410 return 0; 2412 2411 2413 - for_each_available_child_of_node(i3cbus_np, node) { 2412 + for_each_available_child_of_node_scoped(i3cbus_np, node) { 2414 2413 ret = of_i3c_master_add_dev(master, node); 2415 - if (ret) { 2416 - of_node_put(node); 2414 + if (ret) 2417 2415 return ret; 2418 - } 2419 2416 } 2420 2417 2421 2418 /*