diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-09-16 09:26:27 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-30 14:18:43 -0400 |
commit | b147405aa8e568750bfa99501c7fa831edef47c9 (patch) | |
tree | 2b62dba41bef71f1bd48a005eaa402a597f43aa3 /drivers/cpufreq | |
parent | 0e645df9c481b932c99cf1fd38c568b42c705408 (diff) |
cpufreq: powernow: 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().
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')
-rw-r--r-- | drivers/cpufreq/powernow-k6.c | 9 | ||||
-rw-r--r-- | drivers/cpufreq/powernow-k7.c | 4 | ||||
-rw-r--r-- | drivers/cpufreq/powernow-k8.c | 4 |
3 files changed, 3 insertions, 14 deletions
diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c index 85f1c8c25ddc..ab1de0d25099 100644 --- a/drivers/cpufreq/powernow-k6.c +++ b/drivers/cpufreq/powernow-k6.c | |||
@@ -145,7 +145,6 @@ static int powernow_k6_target(struct cpufreq_policy *policy, | |||
145 | static int powernow_k6_cpu_init(struct cpufreq_policy *policy) | 145 | static int powernow_k6_cpu_init(struct cpufreq_policy *policy) |
146 | { | 146 | { |
147 | unsigned int i, f; | 147 | unsigned int i, f; |
148 | int result; | ||
149 | 148 | ||
150 | if (policy->cpu != 0) | 149 | if (policy->cpu != 0) |
151 | return -ENODEV; | 150 | return -ENODEV; |
@@ -167,13 +166,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy) | |||
167 | policy->cpuinfo.transition_latency = 200000; | 166 | policy->cpuinfo.transition_latency = 200000; |
168 | policy->cur = busfreq * max_multiplier; | 167 | policy->cur = busfreq * max_multiplier; |
169 | 168 | ||
170 | result = cpufreq_frequency_table_cpuinfo(policy, clock_ratio); | 169 | return cpufreq_table_validate_and_show(policy, clock_ratio); |
171 | if (result) | ||
172 | return result; | ||
173 | |||
174 | cpufreq_frequency_table_get_attr(clock_ratio, policy->cpu); | ||
175 | |||
176 | return 0; | ||
177 | } | 170 | } |
178 | 171 | ||
179 | 172 | ||
diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 14ce480be8ab..c863c13dfcc8 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c | |||
@@ -680,9 +680,7 @@ static int powernow_cpu_init(struct cpufreq_policy *policy) | |||
680 | 680 | ||
681 | policy->cur = powernow_get(0); | 681 | policy->cur = powernow_get(0); |
682 | 682 | ||
683 | cpufreq_frequency_table_get_attr(powernow_table, policy->cpu); | 683 | return cpufreq_table_validate_and_show(policy, powernow_table); |
684 | |||
685 | return cpufreq_frequency_table_cpuinfo(policy, powernow_table); | ||
686 | } | 684 | } |
687 | 685 | ||
688 | static int powernow_cpu_exit(struct cpufreq_policy *policy) | 686 | static int powernow_cpu_exit(struct cpufreq_policy *policy) |
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 2344a9ed17f3..8d4114a043b3 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c | |||
@@ -1156,7 +1156,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1156 | pr_debug("policy current frequency %d kHz\n", pol->cur); | 1156 | pr_debug("policy current frequency %d kHz\n", pol->cur); |
1157 | 1157 | ||
1158 | /* min/max the cpu is capable of */ | 1158 | /* min/max the cpu is capable of */ |
1159 | if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { | 1159 | if (cpufreq_table_validate_and_show(pol, data->powernow_table)) { |
1160 | printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n"); | 1160 | printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n"); |
1161 | powernow_k8_cpu_exit_acpi(data); | 1161 | powernow_k8_cpu_exit_acpi(data); |
1162 | kfree(data->powernow_table); | 1162 | kfree(data->powernow_table); |
@@ -1164,8 +1164,6 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
1164 | return -EINVAL; | 1164 | return -EINVAL; |
1165 | } | 1165 | } |
1166 | 1166 | ||
1167 | cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu); | ||
1168 | |||
1169 | pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n", | 1167 | pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n", |
1170 | data->currfid, data->currvid); | 1168 | data->currfid, data->currvid); |
1171 | 1169 | ||