From: Chandra Seetharaman WARNING: drivers/cpufreq/cpufreq_stats.o - Section mismatch: reference to .init.data:cpufreq_stat_cpu_notifier from .exit.text after 'cleanup_module' (at offset 0x23) WARNING: drivers/cpufreq/cpufreq_stats.o - Section mismatch: reference to .init.text: from .exit.text after 'cleanup_module' (at offset 0x28) Make cpufreq_stat_cpu_callback() and cpufreq_stat_cpu_notifier available irrespective of whether HOTPLUG_CPU is defined or not. Also, use hotplug version of register/unregister cpu_notifiers. Signed-off-by: Chandra Seetharaman Signed-off-by: Andrew Morton --- drivers/cpufreq/cpufreq_stats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/cpufreq/cpufreq_stats.c~cpu-hotplug-make-register_cpu_notifier-init-time-only-fix drivers/cpufreq/cpufreq_stats.c --- a/drivers/cpufreq/cpufreq_stats.c~cpu-hotplug-make-register_cpu_notifier-init-time-only-fix +++ a/drivers/cpufreq/cpufreq_stats.c @@ -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, _