driver-core/cpu: Expose hotpluggability to the rest of the kernel
[firefly-linux-kernel-4.4.55.git] / drivers / base / cpu.c
index 251acea3d35986dc13f3b5f8423eb803d37508f4..3991502b21e55103fcc780c4651a880c05226625 100644 (file)
@@ -247,6 +247,13 @@ struct sys_device *get_cpu_sysdev(unsigned cpu)
 }
 EXPORT_SYMBOL_GPL(get_cpu_sysdev);
 
+bool cpu_is_hotpluggable(unsigned cpu)
+{
+       struct sys_device *dev = get_cpu_sysdev(cpu);
+       return dev && container_of(dev, struct cpu, sysdev)->hotpluggable;
+}
+EXPORT_SYMBOL_GPL(cpu_is_hotpluggable);
+
 int __init cpu_dev_init(void)
 {
        int err;