Skip to content

Commit 5e5abae

Browse files
committed
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>
1 parent 1f0fe1f commit 5e5abae

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎arch/openrisc/kernel/setup.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,8 @@ static struct device_node *setup_find_cpu_node(int cpu)
158158
{
159159
u32 hwid;
160160
struct device_node *cpun;
161-
struct device_node *cpus = of_find_node_by_path("/cpus");
162161

163-
for_each_available_child_of_node(cpus, cpun) {
162+
for_each_of_cpu_node(cpun) {
164163
if (of_property_read_u32(cpun, "reg", &hwid))
165164
continue;
166165
if (hwid == cpu)

0 commit comments

Comments
 (0)