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

cpufreq: speedstep: 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 4a1fe2bf
...@@ -345,7 +345,6 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) ...@@ -345,7 +345,6 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu); struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu);
unsigned freq; unsigned freq;
unsigned l, h; unsigned l, h;
int ret;
int i; int i;
/* Only Intel makes Enhanced Speedstep-capable CPUs */ /* Only Intel makes Enhanced Speedstep-capable CPUs */
...@@ -402,15 +401,8 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) ...@@ -402,15 +401,8 @@ static int centrino_cpu_init(struct cpufreq_policy *policy)
pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur); pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur);
ret = cpufreq_frequency_table_cpuinfo(policy, return cpufreq_table_validate_and_show(policy,
per_cpu(centrino_model, policy->cpu)->op_points); per_cpu(centrino_model, policy->cpu)->op_points);
if (ret)
return (ret);
cpufreq_frequency_table_get_attr(
per_cpu(centrino_model, policy->cpu)->op_points, policy->cpu);
return 0;
} }
static int centrino_cpu_exit(struct cpufreq_policy *policy) static int centrino_cpu_exit(struct cpufreq_policy *policy)
......
...@@ -320,7 +320,6 @@ static void get_freqs_on_cpu(void *_get_freqs) ...@@ -320,7 +320,6 @@ static void get_freqs_on_cpu(void *_get_freqs)
static int speedstep_cpu_init(struct cpufreq_policy *policy) static int speedstep_cpu_init(struct cpufreq_policy *policy)
{ {
int result;
unsigned int policy_cpu, speed; unsigned int policy_cpu, speed;
struct get_freqs gf; struct get_freqs gf;
...@@ -349,13 +348,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) ...@@ -349,13 +348,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
/* cpuinfo and default policy values */ /* cpuinfo and default policy values */
policy->cur = speed; policy->cur = speed;
result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); return cpufreq_table_validate_and_show(policy, speedstep_freqs);
if (result)
return result;
cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
return 0;
} }
......
...@@ -329,13 +329,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) ...@@ -329,13 +329,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
policy->cur = speed; policy->cur = speed;
result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); return cpufreq_table_validate_and_show(policy, speedstep_freqs);
if (result)
return result;
cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu);
return 0;
} }
static int speedstep_cpu_exit(struct cpufreq_policy *policy) static int speedstep_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