aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/powernow-k8.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-10-03 10:58:17 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-15 18:50:26 -0400
commitd63bd27fe953daa402a108e141c36dcc59c6931c (patch)
tree64aefd0bf380dfca51ea3861eb111b805683edc5 /drivers/cpufreq/powernow-k8.c
parent2633a46c581baa2a9bc33737dfbc792745e30554 (diff)
cpufreq: powernow: Use generic cpufreq routines
Most of the CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patch uses these generic routines in the powernow driver. 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/powernow-k8.c')
-rw-r--r--drivers/cpufreq/powernow-k8.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index 8d4114a043b3..1e6f68af87a4 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -1053,17 +1053,6 @@ static int powernowk8_target(struct cpufreq_policy *pol,
1053 return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta); 1053 return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta);
1054} 1054}
1055 1055
1056/* Driver entry point to verify the policy and range of frequencies */
1057static int powernowk8_verify(struct cpufreq_policy *pol)
1058{
1059 struct powernow_k8_data *data = per_cpu(powernow_data, pol->cpu);
1060
1061 if (!data)
1062 return -EINVAL;
1063
1064 return cpufreq_frequency_table_verify(pol, data->powernow_table);
1065}
1066
1067struct init_on_cpu { 1056struct init_on_cpu {
1068 struct powernow_k8_data *data; 1057 struct powernow_k8_data *data;
1069 int rc; 1058 int rc;
@@ -1225,20 +1214,15 @@ out:
1225 return khz; 1214 return khz;
1226} 1215}
1227 1216
1228static struct freq_attr *powernow_k8_attr[] = {
1229 &cpufreq_freq_attr_scaling_available_freqs,
1230 NULL,
1231};
1232
1233static struct cpufreq_driver cpufreq_amd64_driver = { 1217static struct cpufreq_driver cpufreq_amd64_driver = {
1234 .verify = powernowk8_verify, 1218 .verify = cpufreq_generic_frequency_table_verify,
1235 .target = powernowk8_target, 1219 .target = powernowk8_target,
1236 .bios_limit = acpi_processor_get_bios_limit, 1220 .bios_limit = acpi_processor_get_bios_limit,
1237 .init = powernowk8_cpu_init, 1221 .init = powernowk8_cpu_init,
1238 .exit = powernowk8_cpu_exit, 1222 .exit = powernowk8_cpu_exit,
1239 .get = powernowk8_get, 1223 .get = powernowk8_get,
1240 .name = "powernow-k8", 1224 .name = "powernow-k8",
1241 .attr = powernow_k8_attr, 1225 .attr = cpufreq_generic_attr,
1242}; 1226};
1243 1227
1244static void __request_acpi_cpufreq(void) 1228static void __request_acpi_cpufreq(void)