diff options
-rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 18 |
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 | ||
167 | static void | 167 | static void __cpuexit cpufreq_stats_free_table(unsigned int cpu) |
168 | cpufreq_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 | ||
308 | static int cpufreq_stat_cpu_callback(struct notifier_block *nfb, | 307 | static 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 | ||
326 | static struct notifier_block cpufreq_stat_cpu_notifier = | 326 | static 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 | ||
380 | MODULE_AUTHOR ("Zou Nan hai <nanhai.zou@intel.com>"); | 378 | MODULE_AUTHOR ("Zou Nan hai <nanhai.zou@intel.com>"); |
381 | MODULE_DESCRIPTION ("'cpufreq_stats' - A driver to export cpufreq stats" | 379 | MODULE_DESCRIPTION ("'cpufreq_stats' - A driver to export cpufreq stats " |
382 | "through sysfs filesystem"); | 380 | "through sysfs filesystem"); |
383 | MODULE_LICENSE ("GPL"); | 381 | MODULE_LICENSE ("GPL"); |
384 | 382 | ||