mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
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>
(cherry picked from commit f86e4718f2)
Signed-off-by: Huang, Tao <huangtao@rock-chips.com>
Conflicts:
drivers/base/cpu.c
This commit is contained in:
committed by
Huang, Tao
parent
17685ec17a
commit
81f35ed60f
@@ -319,6 +319,7 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
|
||||
cpu->dev.id = num;
|
||||
cpu->dev.bus = &cpu_subsys;
|
||||
cpu->dev.release = cpu_device_release;
|
||||
cpu->dev.of_node = of_get_cpu_node(num, NULL);
|
||||
#ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
|
||||
cpu->dev.bus->uevent = cpu_uevent;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user