summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/sparc-us2e-cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-09-16 18:56:06 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-30 20:18:41 +0200
commit18f130ed75ab98573694fa6d8542c7891ccc9447 (patch)
tree2f81963a38aacba02c2aed0629de2bb96a8486d0 /drivers/cpufreq/sparc-us2e-cpufreq.c
parent5c40e052bb04381302c748497076b5b4526ed6cb (diff)
downloadlinux-stable-18f130ed75ab98573694fa6d8542c7891ccc9447.tar.gz
linux-stable-18f130ed75ab98573694fa6d8542c7891ccc9447.tar.bz2
linux-stable-18f130ed75ab98573694fa6d8542c7891ccc9447.zip
cpufreq: sparc: call cpufreq_frequency_table_get_attr()
This exposes frequency table of driver to cpufreq core and is required for core to guess what the index for a target frequency is, when it calls cpufreq_frequency_table_target(). And so this driver needs to expose it. Cc: David S. Miller <davem@davemloft.net> 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/sparc-us2e-cpufreq.c')
-rw-r--r--drivers/cpufreq/sparc-us2e-cpufreq.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c
index cf5bc2ca16fa..63b3eae5ffdc 100644
--- a/drivers/cpufreq/sparc-us2e-cpufreq.c
+++ b/drivers/cpufreq/sparc-us2e-cpufreq.c
@@ -307,6 +307,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
struct cpufreq_frequency_table *table =
&us2e_freq_table[cpu].table[0];
+ int ret;
table[0].driver_data = 0;
table[0].frequency = clock_tick / 1;
@@ -324,13 +325,18 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = 0;
policy->cur = clock_tick;
- return cpufreq_frequency_table_cpuinfo(policy, table);
+ ret = cpufreq_frequency_table_cpuinfo(policy, table);
+ if (!ret)
+ cpufreq_frequency_table_get_attr(table, policy->cpu);
+ return ret;
}
static int us2e_freq_cpu_exit(struct cpufreq_policy *policy)
{
- if (cpufreq_us2e_driver)
+ if (cpufreq_us2e_driver) {
+ cpufreq_frequency_table_put_attr(policy->cpu);
us2e_set_cpu_divider_index(policy, 0);
+ }
return 0;
}