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.

cdx: 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: Jonathan Cameron <jonathan.cameron@huawei.com>
Link: https://patch.msgid.link/20260109-of-for-each-compatible-scoped-v3-6-c22fa2c0749a@oss.qualcomm.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Rob Herring (Arm)
2ff81fe3 9572933b

+1 -3
+1 -3
drivers/cdx/cdx.c
··· 608 608 { 609 609 struct cdx_controller *cdx; 610 610 struct platform_device *pd; 611 - struct device_node *np; 612 611 bool val; 613 612 614 613 if (kstrtobool(buf, &val) < 0) ··· 622 623 cdx_unregister_devices(&cdx_bus_type); 623 624 624 625 /* Rescan all the devices */ 625 - for_each_compatible_node(np, NULL, compat_node_name) { 626 + for_each_compatible_node_scoped(np, NULL, compat_node_name) { 626 627 pd = of_find_device_by_node(np); 627 628 if (!pd) { 628 - of_node_put(np); 629 629 count = -EINVAL; 630 630 goto unlock; 631 631 }