diff options
author | Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | 2013-06-17 07:58:45 -0400 |
---|---|---|
committer | Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com> | 2013-08-21 05:29:30 -0400 |
commit | f86e4718f24b83be0c42894d2b97accc993d65d3 (patch) | |
tree | 4db96ad4430daf64920b689d516626ab2e09821a | |
parent | 973e02c1e89768d13be259bf77f88b5cfd16bade (diff) |
driver/core: cpu: initialize of_node in cpu's device struture
CPUs are also registered as devices but the of_node in these cpu
devices are not initialized. Currently different drivers requiring
to access cpu device node are parsing the nodes themselves and
initialising the of_node in cpu device.
The of_node in all the cpu devices needs to be initialized properly
and at one place. The best place to update this is CPU subsystem
driver when registering the cpu devices.
The OF/DT core library now provides of_get_cpu_node to retrieve a cpu
device node for a given logical index by abstracting the architecture
specific details.
This patch uses of_get_cpu_node to assign of_node when registering the
cpu devices.
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
-rw-r--r-- | drivers/base/cpu.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 4c358bc44c72..4cf071764be3 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/percpu.h> | 15 | #include <linux/percpu.h> |
16 | #include <linux/acpi.h> | 16 | #include <linux/acpi.h> |
17 | #include <linux/of.h> | ||
17 | 18 | ||
18 | #include "base.h" | 19 | #include "base.h" |
19 | 20 | ||
@@ -289,6 +290,7 @@ int register_cpu(struct cpu *cpu, int num) | |||
289 | cpu->dev.release = cpu_device_release; | 290 | cpu->dev.release = cpu_device_release; |
290 | cpu->dev.offline_disabled = !cpu->hotpluggable; | 291 | cpu->dev.offline_disabled = !cpu->hotpluggable; |
291 | cpu->dev.offline = !cpu_online(num); | 292 | cpu->dev.offline = !cpu_online(num); |
293 | cpu->dev.of_node = of_get_cpu_node(num, NULL); | ||
292 | #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE | 294 | #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE |
293 | cpu->dev.bus->uevent = arch_cpu_uevent; | 295 | cpu->dev.bus->uevent = arch_cpu_uevent; |
294 | #endif | 296 | #endif |