aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/cpu.c9
-rw-r--r--include/asm-i386/smp.h3
-rw-r--r--include/linux/cpu.h1
3 files changed, 6 insertions, 7 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index bdd7e9f55c81..0bf2dc11cdb8 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -16,9 +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 19int __attribute__((weak)) smp_prepare_cpu (int cpu)
20#define smp_prepare_cpu(cpu) (0) 20{
21#endif 21 return 0;
22}
22 23
23static ssize_t show_online(struct sys_device *dev, char *buf) 24static ssize_t show_online(struct sys_device *dev, char *buf)
24{ 25{
@@ -41,7 +42,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
41 break; 42 break;
42 case '1': 43 case '1':
43 ret = smp_prepare_cpu(cpu->sysdev.id); 44 ret = smp_prepare_cpu(cpu->sysdev.id);
44 if (ret == 0) 45 if (!ret)
45 ret = cpu_up(cpu->sysdev.id); 46 ret = cpu_up(cpu->sysdev.id);
46 break; 47 break;
47 default: 48 default:
diff --git a/include/asm-i386/smp.h b/include/asm-i386/smp.h
index c9996eda5408..edad9b4712fa 100644
--- a/include/asm-i386/smp.h
+++ b/include/asm-i386/smp.h
@@ -51,9 +51,6 @@ extern u8 x86_cpu_to_apicid[];
51#ifdef CONFIG_HOTPLUG_CPU 51#ifdef CONFIG_HOTPLUG_CPU
52extern void cpu_exit_clear(void); 52extern void cpu_exit_clear(void);
53extern void cpu_uninit(void); 53extern void cpu_uninit(void);
54
55#define __HAVE_ARCH_SMP_PREPARE_CPU
56extern int smp_prepare_cpu(int cpu);
57#endif 54#endif
58 55
59/* 56/*
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index fe0298e5dae1..e8904c0da686 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -69,6 +69,7 @@ extern struct semaphore cpucontrol;
69 register_cpu_notifier(&fn##_nb); \ 69 register_cpu_notifier(&fn##_nb); \
70} 70}
71int cpu_down(unsigned int cpu); 71int cpu_down(unsigned int cpu);
72extern int __attribute__((weak)) smp_prepare_cpu(int cpu);
72#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu)) 73#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
73#else 74#else
74#define lock_cpu_hotplug() do { } while (0) 75#define lock_cpu_hotplug() do { } while (0)