Skip to content

Commit 1adce50

Browse files
krzkrobherring
authored andcommitted
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>
1 parent 9d4ba11 commit 1adce50

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

arch/arm/mach-exynos/exynos.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,25 +47,21 @@ unsigned int exynos_rev(void)
4747

4848
void __init exynos_sysram_init(void)
4949
{
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") {
5351
struct resource res;
5452
if (!of_device_is_available(node))
5553
continue;
5654

5755
of_address_to_resource(node, 0, &res);
5856
sysram_base_addr = ioremap(res.start, resource_size(&res));
5957
sysram_base_phys = res.start;
60-
of_node_put(node);
6158
break;
6259
}
6360

64-
for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") {
61+
for_each_compatible_node_scoped(node, NULL, "samsung,exynos4210-sysram-ns") {
6562
if (!of_device_is_available(node))
6663
continue;
6764
sysram_ns_base_addr = of_iomap(node, 0);
68-
of_node_put(node);
6965
break;
7066
}
7167
}

0 commit comments

Comments
 (0)