Commit f1a707c0 authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

cpufreq: sparc: use cpufreq_table_validate_and_show()

Lets use cpufreq_table_validate_and_show() instead of calling
cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr().

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent c25d01b3
...@@ -307,7 +307,6 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) ...@@ -307,7 +307,6 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
struct cpufreq_frequency_table *table = struct cpufreq_frequency_table *table =
&us2e_freq_table[cpu].table[0]; &us2e_freq_table[cpu].table[0];
int ret;
table[0].driver_data = 0; table[0].driver_data = 0;
table[0].frequency = clock_tick / 1; table[0].frequency = clock_tick / 1;
...@@ -325,10 +324,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy) ...@@ -325,10 +324,7 @@ static int __init us2e_freq_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = 0; policy->cpuinfo.transition_latency = 0;
policy->cur = clock_tick; policy->cur = clock_tick;
ret = cpufreq_frequency_table_cpuinfo(policy, table); return cpufreq_table_validate_and_show(policy, table);
if (!ret)
cpufreq_frequency_table_get_attr(table, policy->cpu);
return ret;
} }
static int us2e_freq_cpu_exit(struct cpufreq_policy *policy) static int us2e_freq_cpu_exit(struct cpufreq_policy *policy)
......
...@@ -168,7 +168,6 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) ...@@ -168,7 +168,6 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000; unsigned long clock_tick = sparc64_get_clock_tick(cpu) / 1000;
struct cpufreq_frequency_table *table = struct cpufreq_frequency_table *table =
&us3_freq_table[cpu].table[0]; &us3_freq_table[cpu].table[0];
int ret;
table[0].driver_data = 0; table[0].driver_data = 0;
table[0].frequency = clock_tick / 1; table[0].frequency = clock_tick / 1;
...@@ -182,11 +181,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy) ...@@ -182,11 +181,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = 0; policy->cpuinfo.transition_latency = 0;
policy->cur = clock_tick; policy->cur = clock_tick;
ret = cpufreq_frequency_table_cpuinfo(policy, table); return cpufreq_table_validate_and_show(policy, table);
if (!ret)
cpufreq_frequency_table_get_attr(table, policy->cpu);
return ret;
} }
static int us3_freq_cpu_exit(struct cpufreq_policy *policy) static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment