diff options
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r-- | drivers/base/cpu.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 6ef3069b5710..b79badd0f158 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -16,6 +16,11 @@ struct sysdev_class cpu_sysdev_class = { | |||
16 | EXPORT_SYMBOL(cpu_sysdev_class); | 16 | EXPORT_SYMBOL(cpu_sysdev_class); |
17 | 17 | ||
18 | #ifdef CONFIG_HOTPLUG_CPU | 18 | #ifdef CONFIG_HOTPLUG_CPU |
19 | int __attribute__((weak)) smp_prepare_cpu (int cpu) | ||
20 | { | ||
21 | return 0; | ||
22 | } | ||
23 | |||
19 | static ssize_t show_online(struct sys_device *dev, char *buf) | 24 | static ssize_t show_online(struct sys_device *dev, char *buf) |
20 | { | 25 | { |
21 | struct cpu *cpu = container_of(dev, struct cpu, sysdev); | 26 | 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, | |||
36 | kobject_hotplug(&dev->kobj, KOBJ_OFFLINE); | 41 | kobject_hotplug(&dev->kobj, KOBJ_OFFLINE); |
37 | break; | 42 | break; |
38 | case '1': | 43 | case '1': |
39 | ret = cpu_up(cpu->sysdev.id); | 44 | ret = smp_prepare_cpu(cpu->sysdev.id); |
45 | if (!ret) | ||
46 | ret = cpu_up(cpu->sysdev.id); | ||
47 | if (!ret) | ||
48 | kobject_hotplug(&dev->kobj, KOBJ_ONLINE); | ||
40 | break; | 49 | break; |
41 | default: | 50 | default: |
42 | ret = -EINVAL; | 51 | ret = -EINVAL; |