diff options
author | Jiri Kosina <jkosina@suse.cz> | 2012-02-06 16:11:09 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-02-06 16:12:16 +0100 |
commit | d4730ace0c7dbb64513e35b6fc5fd7e7f381e490 (patch) | |
tree | 18890c096cdd869a593c56de3257faa40af8e050 /drivers/base/cpu.c | |
parent | c1c454b8691cc95aa83f19273ed7845914c70e83 (diff) | |
parent | 23783f817bceedd6d4e549385e3f400ea64059e5 (diff) | |
download | kernel_goldelico_gta04-d4730ace0c7dbb64513e35b6fc5fd7e7f381e490.zip kernel_goldelico_gta04-d4730ace0c7dbb64513e35b6fc5fd7e7f381e490.tar.gz kernel_goldelico_gta04-d4730ace0c7dbb64513e35b6fc5fd7e7f381e490.tar.bz2 |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into upstream-fixes
Sync with Linus' tree. This is necessary to have a base for
patch that fixes commit 35b4c01e29b ("power_supply: add "powers"
links to self-powered HID devices") which went in through Anton's
tree.
Diffstat (limited to 'drivers/base/cpu.c')
-rw-r--r-- | drivers/base/cpu.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 9a5578e..db87e78 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -2,6 +2,7 @@ * CPU subsystem support */ +#include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <linux/sched.h> @@ -10,6 +11,7 @@ #include <linux/device.h> #include <linux/node.h> #include <linux/gfp.h> +#include <linux/percpu.h> #include "base.h" @@ -274,16 +276,30 @@ bool cpu_is_hotpluggable(unsigned cpu) } EXPORT_SYMBOL_GPL(cpu_is_hotpluggable); -int __init cpu_dev_init(void) +#ifdef CONFIG_GENERIC_CPU_DEVICES +static DEFINE_PER_CPU(struct cpu, cpu_devices); +#endif + +static void __init cpu_dev_register_generic(void) +{ +#ifdef CONFIG_GENERIC_CPU_DEVICES + int i; + + for_each_possible_cpu(i) { + if (register_cpu(&per_cpu(cpu_devices, i), i)) + panic("Failed to register CPU device"); + } +#endif +} + +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; + cpu_dev_register_generic(); #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 - return err; } |