diff options
| author | Len Brown <len.brown@intel.com> | 2004-10-27 19:41:43 -0400 |
|---|---|---|
| committer | Len Brown <lenb@dhcppc3.> | 2004-10-27 19:41:43 -0400 |
| commit | 88a664ec70b650ef6d00a47c63776ae27416c23e (patch) | |
| tree | 1e0d292143c183e54cfb2c352af06a0294554cdf /drivers/base/cpu.c | |
| parent | fd613a86b7f6c884d36a888a63739df449e7eed0 (diff) | |
IA64 CPU hotplug topology
Extend support for dynamic registration and unregistration of the cpu,
by implementing and exporting arch_register_cpu()/arch_unregister_cpu().
Also combine multiple implementation of topology_init() functions to
single topology_init() in case of ia64 architecture.
Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/base/cpu.c')
| -rw-r--r-- | drivers/base/cpu.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 42f4337f9627..8fb216f575f3 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -48,10 +48,23 @@ static ssize_t store_online(struct sys_device *dev, const char *buf, } static SYSDEV_ATTR(online, 0600, show_online, store_online); -static void __init register_cpu_control(struct cpu *cpu) +static void __devinit register_cpu_control(struct cpu *cpu) { sysdev_create_file(&cpu->sysdev, &attr_online); } +void unregister_cpu(struct cpu *cpu, struct node *root) +{ + + if (root) + sysfs_remove_link(&root->sysdev.kobj, + kobject_name(&cpu->sysdev.kobj)); + sysdev_remove_file(&cpu->sysdev, &attr_online); + + sysdev_unregister(&cpu->sysdev); + + return; +} +EXPORT_SYMBOL(unregister_cpu); #else /* ... !CONFIG_HOTPLUG_CPU */ static inline void register_cpu_control(struct cpu *cpu) { @@ -66,7 +79,7 @@ static inline void register_cpu_control(struct cpu *cpu) * * Initialize and register the CPU device. */ -int __init register_cpu(struct cpu *cpu, int num, struct node *root) +int __devinit register_cpu(struct cpu *cpu, int num, struct node *root) { int error; @@ -83,6 +96,9 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root) register_cpu_control(cpu); return error; } +#ifdef CONFIG_HOTPLUG_CPU +EXPORT_SYMBOL(register_cpu); +#endif |
