diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-10-02 04:43:19 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-15 18:50:23 -0400 |
commit | be49e3465f222b4b796be8a21d14afbfd8f5d20f (patch) | |
tree | e1ef5d9cb453bb3c7f073a4d209d2b63d980aec3 /drivers/cpufreq/integrator-cpufreq.c | |
parent | 0b981e70748861a3e10ea2e2a689bdcee3e15085 (diff) |
cpufreq: add new routine cpufreq_verify_within_cpu_limits()
Most of the users of cpufreq_verify_within_limits() calls it for
limiting with min/max from policy->cpuinfo. We can make that code
simple by introducing another routine which will do this for them
automatically.
This patch adds another routine cpufreq_verify_within_cpu_limits()
and updates others to use it.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/integrator-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/integrator-cpufreq.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/cpufreq/integrator-cpufreq.c b/drivers/cpufreq/integrator-cpufreq.c index f7c99df0880b..8152a9bb7e2c 100644 --- a/drivers/cpufreq/integrator-cpufreq.c +++ b/drivers/cpufreq/integrator-cpufreq.c | |||
@@ -59,9 +59,7 @@ static int integrator_verify_policy(struct cpufreq_policy *policy) | |||
59 | { | 59 | { |
60 | struct icst_vco vco; | 60 | struct icst_vco vco; |
61 | 61 | ||
62 | cpufreq_verify_within_limits(policy, | 62 | cpufreq_verify_within_cpu_limits(policy); |
63 | policy->cpuinfo.min_freq, | ||
64 | policy->cpuinfo.max_freq); | ||
65 | 63 | ||
66 | vco = icst_hz_to_vco(&cclk_params, policy->max * 1000); | 64 | vco = icst_hz_to_vco(&cclk_params, policy->max * 1000); |
67 | policy->max = icst_hz(&cclk_params, vco) / 1000; | 65 | policy->max = icst_hz(&cclk_params, vco) / 1000; |
@@ -69,10 +67,7 @@ static int integrator_verify_policy(struct cpufreq_policy *policy) | |||
69 | vco = icst_hz_to_vco(&cclk_params, policy->min * 1000); | 67 | vco = icst_hz_to_vco(&cclk_params, policy->min * 1000); |
70 | policy->min = icst_hz(&cclk_params, vco) / 1000; | 68 | policy->min = icst_hz(&cclk_params, vco) / 1000; |
71 | 69 | ||
72 | cpufreq_verify_within_limits(policy, | 70 | cpufreq_verify_within_cpu_limits(policy); |
73 | policy->cpuinfo.min_freq, | ||
74 | policy->cpuinfo.max_freq); | ||
75 | |||
76 | return 0; | 71 | return 0; |
77 | } | 72 | } |
78 | 73 | ||