diff options
author | Rafael J. Wysocki <rjw@rjwysocki.net> | 2013-10-25 22:36:40 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rjw@rjwysocki.net> | 2013-10-25 22:36:40 +0200 |
commit | 6ddee424fea2d269c2f402278d93165c7b92dc58 (patch) | |
tree | c1b1d0d9058846a6da22def648dea61e16faacd0 /drivers/cpufreq/spear-cpufreq.c | |
parent | PM / OPP: rename header to linux/pm_opp.h (diff) | |
parent | cpufreq / governor: Remove fossil comment (diff) | |
download | linux-6ddee424fea2d269c2f402278d93165c7b92dc58.tar.xz linux-6ddee424fea2d269c2f402278d93165c7b92dc58.zip |
Merge back earlier 'pm-cpufreq' material.
Conflicts:
drivers/cpufreq/omap-cpufreq.c
Diffstat (limited to 'drivers/cpufreq/spear-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/spear-cpufreq.c | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 3f418166ce02..8841366a2068 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -30,11 +30,6 @@ static struct { u32 cnt; } spear_cpufreq; -static int spear_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, spear_cpufreq.freq_tbl); -} - static unsigned int spear_cpufreq_get(unsigned int cpu) { return clk_get_rate(spear_cpufreq.clk) / 1000; @@ -176,43 +171,19 @@ static int spear_cpufreq_target(struct cpufreq_policy *policy, static int spear_cpufreq_init(struct cpufreq_policy *policy) { - int ret; - - ret = cpufreq_frequency_table_cpuinfo(policy, spear_cpufreq.freq_tbl); - if (ret) { - pr_err("cpufreq_frequency_table_cpuinfo() failed"); - return ret; - } - - cpufreq_frequency_table_get_attr(spear_cpufreq.freq_tbl, policy->cpu); - policy->cpuinfo.transition_latency = spear_cpufreq.transition_latency; - policy->cur = spear_cpufreq_get(0); - - cpumask_setall(policy->cpus); - - return 0; -} - -static int spear_cpufreq_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; + return cpufreq_generic_init(policy, spear_cpufreq.freq_tbl, + spear_cpufreq.transition_latency); } -static struct freq_attr *spear_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver spear_cpufreq_driver = { .name = "cpufreq-spear", .flags = CPUFREQ_STICKY, - .verify = spear_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = spear_cpufreq_target, .get = spear_cpufreq_get, .init = spear_cpufreq_init, - .exit = spear_cpufreq_exit, - .attr = spear_cpufreq_attr, + .exit = cpufreq_generic_exit, + .attr = cpufreq_generic_attr, }; static int spear_cpufreq_driver_init(void) |