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.

ARM: exynos: Simplify with scoped for each OF child loop

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

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Link: https://patch.msgid.link/20260109-of-for-each-compatible-scoped-v3-3-c22fa2c0749a@oss.qualcomm.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Rob Herring (Arm)
1adce508 9d4ba117

+2 -6
+2 -6
arch/arm/mach-exynos/exynos.c
··· 47 47 48 48 void __init exynos_sysram_init(void) 49 49 { 50 - struct device_node *node; 51 - 52 - for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") { 50 + for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram") { 53 51 struct resource res; 54 52 if (!of_device_is_available(node)) 55 53 continue; ··· 55 57 of_address_to_resource(node, 0, &res); 56 58 sysram_base_addr = ioremap(res.start, resource_size(&res)); 57 59 sysram_base_phys = res.start; 58 - of_node_put(node); 59 60 break; 60 61 } 61 62 62 - for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") { 63 + for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram-ns") { 63 64 if (!of_device_is_available(node)) 64 65 continue; 65 66 sysram_ns_base_addr = of_iomap(node, 0); 66 - of_node_put(node); 67 67 break; 68 68 } 69 69 }