]> err.no Git - linux-2.6/blobdiff - drivers/base/cpu.c
[PATCH] pipe: remove redundant fifo_poll abstraction
[linux-2.6] / drivers / base / cpu.c
index 6ef3069b57107f2e12c5d2c7f238b77f5dacd97c..b79badd0f1588dea649df9033652f0f5d2afbacf 100644 (file)
@@ -16,6 +16,11 @@ struct sysdev_class cpu_sysdev_class = {
 EXPORT_SYMBOL(cpu_sysdev_class);
 
 #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);
@@ -36,7 +41,11 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
                        kobject_hotplug(&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_hotplug(&dev->kobj, KOBJ_ONLINE);
                break;
        default:
                ret = -EINVAL;