aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r--drivers/base/cpu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 6ef3069b5710..bdd7e9f55c81 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -16,6 +16,10 @@ struct sysdev_class cpu_sysdev_class = {
16EXPORT_SYMBOL(cpu_sysdev_class); 16EXPORT_SYMBOL(cpu_sysdev_class);
17 17
18#ifdef CONFIG_HOTPLUG_CPU 18#ifdef CONFIG_HOTPLUG_CPU
19#ifndef __HAVE_ARCH_SMP_PREPARE_CPU
20#define smp_prepare_cpu(cpu) (0)
21#endif
22
19static ssize_t show_online(struct sys_device *dev, char *buf) 23static ssize_t show_online(struct sys_device *dev, char *buf)
20{ 24{
21 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 25 struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@ -36,7 +40,9 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
36 kobject_hotplug(&dev->kobj, KOBJ_OFFLINE); 40 kobject_hotplug(&dev->kobj, KOBJ_OFFLINE);
37 break; 41 break;
38 case '1': 42 case '1':
39 ret = cpu_up(cpu->sysdev.id); 43 ret = smp_prepare_cpu(cpu->sysdev.id);
44 if (ret == 0)
45 ret = cpu_up(cpu->sysdev.id);
40 break; 46 break;
41 default: 47 default:
42 ret = -EINVAL; 48 ret = -EINVAL;