diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2011-08-04 16:13:20 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2011-08-04 16:13:20 -0700 |
commit | 17b0436077d99211d8b26886235a36c5ec54ac57 (patch) | |
tree | 8bcd9b4a0f8285f749814e95ae0365c611ba2392 /drivers/cpufreq/cpufreq_stats.c | |
parent | aafade242ff24fac3aabf61c7861dfa44a3c2445 (diff) | |
parent | 02f8c6aee8df3cdc935e9bdd4f2d020306035dbe (diff) |
Merge commit 'v3.0' into x86/vdso
Diffstat (limited to 'drivers/cpufreq/cpufreq_stats.c')
-rw-r--r-- | drivers/cpufreq/cpufreq_stats.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_stats.c b/drivers/cpufreq/cpufreq_stats.c index b60a4c26368..faf7c521784 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, old_index = stat->last_index; new_index = freq_table_get_index(stat, freq->new); - cpufreq_stats_update(freq->cpu); - if (old_index == new_index) + /* We can't do stat->time_in_state[-1]= .. */ + if (old_index == -1 || new_index == -1) return 0; - if (old_index == -1 || new_index == -1) + cpufreq_stats_update(freq->cpu); + + if (old_index == new_index) return 0; spin_lock(&cpufreq_stats_lock); @@ -387,6 +389,7 @@ static void __exit cpufreq_stats_exit(void) unregister_hotcpu_notifier(&cpufreq_stat_cpu_notifier); for_each_online_cpu(cpu) { cpufreq_stats_free_table(cpu); + cpufreq_stats_free_sysfs(cpu); } } |