diff options
-rw-r--r-- | drivers/base/cpu.c | 7 | ||||
-rw-r--r-- | include/linux/cpu.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 251acea3d359..3991502b21e5 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -247,6 +247,13 @@ struct sys_device *get_cpu_sysdev(unsigned cpu) | |||
247 | } | 247 | } |
248 | EXPORT_SYMBOL_GPL(get_cpu_sysdev); | 248 | EXPORT_SYMBOL_GPL(get_cpu_sysdev); |
249 | 249 | ||
250 | bool cpu_is_hotpluggable(unsigned cpu) | ||
251 | { | ||
252 | struct sys_device *dev = get_cpu_sysdev(cpu); | ||
253 | return dev && container_of(dev, struct cpu, sysdev)->hotpluggable; | ||
254 | } | ||
255 | EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); | ||
256 | |||
250 | int __init cpu_dev_init(void) | 257 | int __init cpu_dev_init(void) |
251 | { | 258 | { |
252 | int err; | 259 | int err; |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 6cb60fd2ea84..305c263021e7 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -27,6 +27,7 @@ struct cpu { | |||
27 | 27 | ||
28 | extern int register_cpu(struct cpu *cpu, int num); | 28 | extern int register_cpu(struct cpu *cpu, int num); |
29 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); | 29 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); |
30 | extern bool cpu_is_hotpluggable(unsigned cpu); | ||
30 | 31 | ||
31 | extern int cpu_add_sysdev_attr(struct sysdev_attribute *attr); | 32 | extern int cpu_add_sysdev_attr(struct sysdev_attribute *attr); |
32 | extern void cpu_remove_sysdev_attr(struct sysdev_attribute *attr); | 33 | extern void cpu_remove_sysdev_attr(struct sysdev_attribute *attr); |