X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fbase%2Fcpu.c;h=6ef3069b57107f2e12c5d2c7f238b77f5dacd97c;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=aa66d7198d1c920d1d99248df9e0d4f325b82ec5;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index aa66d7198..6ef3069b5 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -32,6 +32,8 @@ static ssize_t store_online(struct sys_device *dev, const char *buf, switch (buf[0]) { case '0': ret = cpu_down(cpu->sysdev.id); + if (!ret) + kobject_hotplug(&dev->kobj, KOBJ_OFFLINE); break; case '1': ret = cpu_up(cpu->sysdev.id); @@ -46,10 +48,22 @@ 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; +} #else /* ... !CONFIG_HOTPLUG_CPU */ static inline void register_cpu_control(struct cpu *cpu) { @@ -64,7 +78,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;