aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq_stats.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/cpufreq_stats.c')
-rw-r--r--drivers/cpufreq/cpufreq_stats.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c
index b60a4c263686..faf7c5217848 100644
--- a/drivers/cpufreq/cpufreq_stats.c
+++ b/drivers/cpufreq/cpufreq_stats.c
@@ -298,11 +298,13 @@ static int cpufreq_stat_notifier_trans(struct notifier_block *nb,
298 old_index = stat->last_index; 298 old_index = stat->last_index;
299 new_index = freq_table_get_index(stat, freq->new); 299 new_index = freq_table_get_index(stat, freq->new);
300 300
301 cpufreq_stats_update(freq->cpu); 301 /* We can't do stat->time_in_state[-1]= .. */
302 if (old_index == new_index) 302 if (old_index == -1 || new_index == -1)
303 return 0; 303 return 0;
304 304
305 if (old_index == -1 || new_index == -1) 305 cpufreq_stats_update(freq->cpu);
306
307 if (old_index == new_index)
306 return 0; 308 return 0;
307 309
308 spin_lock(&cpufreq_stats_lock); 310 spin_lock(&cpufreq_stats_lock);
@@ -387,6 +389,7 @@ static void __exit cpufreq_stats_exit(void)
387 unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier); 389 unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier);
388 for_each_online_cpu(cpu) { 390 for_each_online_cpu(cpu) {
389 cpufreq_stats_free_table(cpu); 391 cpufreq_stats_free_table(cpu);
392 cpufreq_stats_free_sysfs(cpu);
390 } 393 }
391} 394}
392 395