[PATCH] cpu hotplug: make [un]register_cpu_notifier init time only
CPUs come online only at init time (unless CONFIG_HOTPLUG_CPU is defined). So, cpu_notifier functionality need to be available only at init time. This patch makes register_cpu_notifier() available only at init time, unless CONFIG_HOTPLUG_CPU is defined. This patch exports register_cpu_notifier() and unregister_cpu_notifier() only if CONFIG_HOTPLUG_CPU is defined. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Cc: Ashok Raj <ashok.raj@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
054cc8a2d8
commit
65edc68c34
@ -350,7 +350,7 @@ __init cpufreq_stats_init(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
register_cpu_notifier(&cpufreq_stat_cpu_notifier);
|
||||
register_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
|
||||
lock_cpu_hotplug();
|
||||
for_each_online_cpu(cpu) {
|
||||
cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier, CPU_ONLINE,
|
||||
@ -368,7 +368,7 @@ __exit cpufreq_stats_exit(void)
|
||||
CPUFREQ_POLICY_NOTIFIER);
|
||||
cpufreq_unregister_notifier(¬ifier_trans_block,
|
||||
CPUFREQ_TRANSITION_NOTIFIER);
|
||||
unregister_cpu_notifier(&cpufreq_stat_cpu_notifier);
|
||||
unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
|
||||
lock_cpu_hotplug();
|
||||
for_each_online_cpu(cpu) {
|
||||
cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier, CPU_DEAD,
|
||||
|
Reference in New Issue
Block a user