summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/powernow-k6.c
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2014-04-28 22:54:27 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-04-29 03:22:53 +0400
commit237ede16ba5bcd4d6c612ea280518c48ca31986c (patch)
tree3936e8dcbf35e6317c49b212ac64a641800dd61c /drivers/cpufreq/powernow-k6.c
parent7aa0557fae5ce26dddc877869c7ad934e71f30db (diff)
downloadlinux-237ede16ba5bcd4d6c612ea280518c48ca31986c.tar.xz
cpufreq: powernow-k6: Fix incorrect comparison with max_multipler
The value of 'max_multiplier' is meant to be used for comparison with clock_ratio[index].driver_data, not the index itself! Fix the code in powernow_k6_cpu_exit() that has this bug. Also, while at it, make the for-loop condition look for CPUFREQ_TABLE_END, instead of hard-coding the loop count to 8. Reported-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/powernow-k6.c')
-rw-r--r--drivers/cpufreq/powernow-k6.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c
index 49f120e1bc7b..695a68cfdcd4 100644
--- a/drivers/cpufreq/powernow-k6.c
+++ b/drivers/cpufreq/powernow-k6.c
@@ -227,8 +227,9 @@ have_busfreq:
static int powernow_k6_cpu_exit(struct cpufreq_policy *policy)
{
unsigned int i;
- for (i = 0; i < 8; i++) {
- if (i == max_multiplier)
+
+ for (i = 0; (clock_ratio[i].frequency != CPUFREQ_TABLE_END); i++) {
+ if (clock_ratio[i].driver_data == max_multiplier)
powernow_k6_target(policy, i);
}
return 0;