vserver 1.9.5.x5
[linux-2.6.git] / drivers / base / cpu.c
index aa66d71..6ef3069 100644 (file)
@@ -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;