aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/at32ap-cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-10-03 10:57:58 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-15 18:50:23 -0400
commit5ae68f4737cec20505f3bb0a99bcb2efcfd66792 (patch)
tree4dad630ee576b229519f303feb523719bc3ba34d /drivers/cpufreq/at32ap-cpufreq.c
parent3c75a1503f2c5ca91279436b1f573002c869ef06 (diff)
cpufreq: at32ap: Use generic cpufreq routines
Most of the CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patch uses these generic routines in the at32ap driver. Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/at32ap-cpufreq.c')
-rw-r--r--drivers/cpufreq/at32ap-cpufreq.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/cpufreq/at32ap-cpufreq.c b/drivers/cpufreq/at32ap-cpufreq.c
index 1d19fa59bc2c..788f7e77565d 100644
--- a/drivers/cpufreq/at32ap-cpufreq.c
+++ b/drivers/cpufreq/at32ap-cpufreq.c
@@ -24,16 +24,6 @@
24static struct clk *cpuclk; 24static struct clk *cpuclk;
25static struct cpufreq_frequency_table *freq_table; 25static struct cpufreq_frequency_table *freq_table;
26 26
27static int at32_verify_speed(struct cpufreq_policy *policy)
28{
29 if (policy->cpu != 0)
30 return -EINVAL;
31
32 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq,
33 policy->cpuinfo.max_freq);
34 return 0;
35}
36
37static unsigned int at32_get_speed(unsigned int cpu) 27static unsigned int at32_get_speed(unsigned int cpu)
38{ 28{
39 /* No SMP support */ 29 /* No SMP support */
@@ -152,7 +142,7 @@ out_err:
152static struct cpufreq_driver at32_driver = { 142static struct cpufreq_driver at32_driver = {
153 .name = "at32ap", 143 .name = "at32ap",
154 .init = at32_cpufreq_driver_init, 144 .init = at32_cpufreq_driver_init,
155 .verify = at32_verify_speed, 145 .verify = cpufreq_generic_frequency_table_verify,
156 .target = at32_set_target, 146 .target = at32_set_target,
157 .get = at32_get_speed, 147 .get = at32_get_speed,
158 .flags = CPUFREQ_STICKY, 148 .flags = CPUFREQ_STICKY,