diff options
author | Inderpal Singh <inderpal.singh@linaro.org> | 2012-03-05 10:27:08 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2012-03-12 10:42:41 +0530 |
commit | f1e420ebe94fb1acd2b6b326c6827fcc8b4a986e (patch) | |
tree | f823025f8c3e923b6eb384f3ecd140c0506817b9 | |
parent | 682745726ab59e4d1be50844edef552b6b2e339f (diff) |
EXYNOS: CPUFREQ: Calculate old_index based on freqs.oldsamsung-lt-v3.3-rc5-3
Do not calculate old_index with cpufreq_frequency_table_target because it
won't give the correct old_index if the policy got changed. Hence, use
freqs.old to calculate old_index.
Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
-rw-r--r-- | drivers/cpufreq/exynos-cpufreq.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 0eba3c7aaa10..79bb6f17b94b 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -48,7 +48,7 @@ static int exynos_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { - unsigned int index, old_index; + unsigned int index, old_index, i; unsigned int arm_volt, safe_arm_volt = 0; int ret = 0; struct cpufreq_frequency_table *freq_table = exynos_info->freq_table; @@ -64,10 +64,11 @@ static int exynos_target(struct cpufreq_policy *policy, goto out; } - if (cpufreq_frequency_table_target(policy, freq_table, - freqs.old, relation, &old_index)) { - ret = -EINVAL; - goto out; + for (i = 0; (freq_table[i].frequency != CPUFREQ_TABLE_END); i++) { + if (freqs.old == freq_table[old_index].frequency) { + old_index = i; + break; + } } if (cpufreq_frequency_table_target(policy, freq_table, |