aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpufreq/cpufreq_stats.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index 917b9bab9ccb..8a45d0f93e26 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -164,8 +164,7 @@ freq_table_get_index(struct cpufreq_stats *stat, unsigned int freq)
164 return -1; 164 return -1;
165} 165}
166 166
167static void 167static void __cpuexit cpufreq_stats_free_table(unsigned int cpu)
168cpufreq_stats_free_table (unsigned int cpu)
169{ 168{
170 struct cpufreq_stats *stat = cpufreq_stats_table[cpu]; 169 struct cpufreq_stats *stat = cpufreq_stats_table[cpu];
171 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); 170 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
@@ -305,8 +304,9 @@ cpufreq_stat_notifier_trans (struct notifier_block *nb, unsigned long val,
305 return 0; 304 return 0;
306} 305}
307 306
308static int cpufreq_stat_cpu_callback(struct notifier_block *nfb, 307static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
309 unsigned long action, void *hcpu) 308 unsigned long action,
309 void *hcpu)
310{ 310{
311 unsigned int cpu = (unsigned long)hcpu; 311 unsigned int cpu = (unsigned long)hcpu;
312 312
@@ -323,7 +323,7 @@ static int cpufreq_stat_cpu_callback(struct notifier_block *nfb,
323 return NOTIFY_OK; 323 return NOTIFY_OK;
324} 324}
325 325
326static struct notifier_block cpufreq_stat_cpu_notifier = 326static struct notifier_block cpufreq_stat_cpu_notifier __cpuinitdata =
327{ 327{
328 .notifier_call = cpufreq_stat_cpu_callback, 328 .notifier_call = cpufreq_stat_cpu_callback,
329}; 329};
@@ -356,8 +356,7 @@ __init cpufreq_stats_init(void)
356 356
357 register_hotcpu_notifier(&cpufreq_stat_cpu_notifier); 357 register_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
358 for_each_online_cpu(cpu) { 358 for_each_online_cpu(cpu) {
359 cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier, 359 cpufreq_update_policy(cpu);
360 CPU_ONLINE, (void *)(long)cpu);
361 } 360 }
362 return 0; 361 return 0;
363} 362}
@@ -372,13 +371,12 @@ __exit cpufreq_stats_exit(void)
372 CPUFREQ_TRANSITION_NOTIFIER); 371 CPUFREQ_TRANSITION_NOTIFIER);
373 unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier); 372 unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
374 for_each_online_cpu(cpu) { 373 for_each_online_cpu(cpu) {
375 cpufreq_stat_cpu_callback(&cpufreq_stat_cpu_notifier, 374 cpufreq_stats_free_table(cpu);
376 CPU_DEAD, (void *)(long)cpu);
377 } 375 }
378} 376}
379 377
380MODULE_AUTHOR ("Zou Nan hai <nanhai.zou@intel.com>"); 378MODULE_AUTHOR ("Zou Nan hai <nanhai.zou@intel.com>");
381MODULE_DESCRIPTION ("'cpufreq_stats' - A driver to export cpufreq stats" 379MODULE_DESCRIPTION ("'cpufreq_stats' - A driver to export cpufreq stats "
382 "through sysfs filesystem"); 380 "through sysfs filesystem");
383MODULE_LICENSE ("GPL"); 381MODULE_LICENSE ("GPL");
384 382