diff options
author | Rob Herring <robh@kernel.org> | 2018-08-27 12:21:39 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-09-28 14:25:58 -0500 |
commit | 5e5abae858b5d3d060a441cc5da0859cd8cb2c82 (patch) | |
tree | 742f3dcce5e3d8395dad08b59e4de89c9d85ea45 /arch | |
parent | 1f0fe1f67cef6fb4029e8a0af90438e8280c80f1 (diff) | |
download | linux-5e5abae858b5d3d060a441cc5da0859cd8cb2c82.tar.bz2 |
openrisc: use for_each_of_cpu_node iterator
Use the for_each_of_cpu_node iterator to iterate over cpu nodes. This
has the side effect of defaulting to iterating using "cpu" node names in
preference to the deprecated (for FDT) device_type == "cpu".
This also fixes a leaked reference for cpus node.
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: openrisc@lists.librecores.org
Acked-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/openrisc/kernel/setup.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/openrisc/kernel/setup.c b/arch/openrisc/kernel/setup.c index 9d28ab14d139..e17fcd83120f 100644 --- a/arch/openrisc/kernel/setup.c +++ b/arch/openrisc/kernel/setup.c @@ -158,9 +158,8 @@ static struct device_node *setup_find_cpu_node(int cpu) { u32 hwid; struct device_node *cpun; - struct device_node *cpus = of_find_node_by_path("/cpus"); - for_each_available_child_of_node(cpus, cpun) { + for_each_of_cpu_node(cpun) { if (of_property_read_u32(cpun, "reg", &hwid)) continue; if (hwid == cpu) |