Commit 024f7846 authored by Ben Hutchings's avatar Ben Hutchings Committed by Linus Torvalds

cpu: Do not return errors from cpu_dev_init() which will be ignored

cpu_dev_init() is only called from driver_init(), which does not check
its return value.  Therefore make cpu_dev_init() return void.

We must register the CPU subsystem, so panic if this fails.

If sched_create_sysfs_power_savings_entries() fails, the damage is
contained, so ignore this (as before).
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4f58cb90
...@@ -94,7 +94,7 @@ extern int hypervisor_init(void); ...@@ -94,7 +94,7 @@ extern int hypervisor_init(void);
static inline int hypervisor_init(void) { return 0; } static inline int hypervisor_init(void) { return 0; }
#endif #endif
extern int platform_bus_init(void); extern int platform_bus_init(void);
extern int cpu_dev_init(void); extern void cpu_dev_init(void);
extern int bus_add_device(struct device *dev); extern int bus_add_device(struct device *dev);
extern void bus_probe_device(struct device *dev); extern void bus_probe_device(struct device *dev);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
* CPU subsystem support * CPU subsystem support
*/ */
#include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -274,16 +275,12 @@ bool cpu_is_hotpluggable(unsigned cpu) ...@@ -274,16 +275,12 @@ bool cpu_is_hotpluggable(unsigned cpu)
} }
EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); EXPORT_SYMBOL_GPL(cpu_is_hotpluggable);
int __init cpu_dev_init(void) void __init cpu_dev_init(void)
{ {
int err; if (subsys_system_register(&cpu_subsys, cpu_root_attr_groups))
panic("Failed to register CPU subsystem");
err = subsys_system_register(&cpu_subsys, cpu_root_attr_groups);
if (err)
return err;
#if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT)
err = sched_create_sysfs_power_savings_entries(cpu_subsys.dev_root); sched_create_sysfs_power_savings_entries(cpu_subsys.dev_root);
#endif #endif
return err;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment