diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2012-01-09 21:59:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 18:49:43 -0500 |
commit | 024f78462c3da710642a54939888a92e28704653 (patch) | |
tree | 6ff97e571b36d66256d09cf06031b56ce789ec7e /drivers/base/cpu.c | |
parent | 4f58cb90bcb04cfe18f524d1c9a65edef5eb3f51 (diff) |
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: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r-- | drivers/base/cpu.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 9a5578efbc93..bba70d08be6a 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * CPU subsystem support | 2 | * CPU subsystem support |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/kernel.h> | ||
5 | #include <linux/module.h> | 6 | #include <linux/module.h> |
6 | #include <linux/init.h> | 7 | #include <linux/init.h> |
7 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
@@ -274,16 +275,12 @@ bool cpu_is_hotpluggable(unsigned cpu) | |||
274 | } | 275 | } |
275 | EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); | 276 | EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); |
276 | 277 | ||
277 | int __init cpu_dev_init(void) | 278 | void __init cpu_dev_init(void) |
278 | { | 279 | { |
279 | int err; | 280 | if (subsys_system_register(&cpu_subsys, cpu_root_attr_groups)) |
280 | 281 | panic("Failed to register CPU subsystem"); | |
281 | err = subsys_system_register(&cpu_subsys, cpu_root_attr_groups); | ||
282 | if (err) | ||
283 | return err; | ||
284 | 282 | ||
285 | #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) | 283 | #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT) |
286 | err = sched_create_sysfs_power_savings_entries(cpu_subsys.dev_root); | 284 | sched_create_sysfs_power_savings_entries(cpu_subsys.dev_root); |
287 | #endif | 285 | #endif |
288 | return err; | ||
289 | } | 286 | } |