diff options
Diffstat (limited to 'arch/x86/kernel/topology.c')
-rw-r--r-- | arch/x86/kernel/topology.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index 0bab03130033..d0acf6c6ff62 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c @@ -35,38 +35,25 @@ #include <asm/io_apic.h> #include <asm/cpu.h> -static DEFINE_PER_CPU(struct x86_cpu, cpu_devices); - #ifdef CONFIG_HOTPLUG_CPU -int arch_register_cpu(int cpu) +int arch_register_cpu(int num) { - struct x86_cpu *xc = per_cpu_ptr(&cpu_devices, cpu); + struct cpu *cpu = per_cpu_ptr(&cpu_devices, num); - xc->cpu.hotpluggable = cpu > 0; - return register_cpu(&xc->cpu, cpu); + cpu->hotpluggable = num > 0; + return register_cpu(cpu, num); } EXPORT_SYMBOL(arch_register_cpu); void arch_unregister_cpu(int num) { - unregister_cpu(&per_cpu(cpu_devices, num).cpu); + unregister_cpu(&per_cpu(cpu_devices, num)); } EXPORT_SYMBOL(arch_unregister_cpu); #else /* CONFIG_HOTPLUG_CPU */ -int __init arch_register_cpu(int num) +int arch_register_cpu(int num) { - return register_cpu(&per_cpu(cpu_devices, num).cpu, num); + return register_cpu(&per_cpu(cpu_devices, num), num); } #endif /* CONFIG_HOTPLUG_CPU */ - -static int __init topology_init(void) -{ - int i; - - for_each_present_cpu(i) - arch_register_cpu(i); - - return 0; -} -subsys_initcall(topology_init); |