Skip to content

Commit

Permalink
of: return of_get_cpu_node from of_cpu_device_node_get if CPUs are no…
Browse files Browse the repository at this point in the history
…t registered

Instead of the callsites choosing between of_cpu_device_node_get if the
CPUs are registered as of_node is populated by then and of_get_cpu_node
when the CPUs are not yet registered as CPU of_nodes are not yet stashed
thereby needing to parse the device tree, we can call of_get_cpu_node
in case the CPUs are not yet registered.

This will allow to use of_cpu_device_node_get anywhere hiding the
details from the caller.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Sudeep Holla authored and Rob Herring committed Aug 21, 2017
1 parent e906e1e commit 7467c9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/of_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static inline struct device_node *of_cpu_device_node_get(int cpu)
struct device *cpu_dev;
cpu_dev = get_cpu_device(cpu);
if (!cpu_dev)
return NULL;
return of_get_cpu_node(cpu, NULL);
return of_node_get(cpu_dev->of_node);
}

Expand Down

0 comments on commit 7467c9d

Please sign in to comment.