linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / base / cpu.c
index dd712b2..29f3d75 100644 (file)
@@ -19,6 +19,11 @@ EXPORT_SYMBOL(cpu_sysdev_class);
 static struct sys_device *cpu_sys_devices[NR_CPUS];
 
 #ifdef CONFIG_HOTPLUG_CPU
+int __attribute__((weak)) smp_prepare_cpu (int cpu)
+{
+       return 0;
+}
+
 static ssize_t show_online(struct sys_device *dev, char *buf)
 {
        struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@ -39,7 +44,9 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
                        kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
                break;
        case '1':
-               ret = cpu_up(cpu->sysdev.id);
+               ret = smp_prepare_cpu(cpu->sysdev.id);
+               if (!ret)
+                       ret = cpu_up(cpu->sysdev.id);
                if (!ret)
                        kobject_uevent(&dev->kobj, KOBJ_ONLINE);
                break;