aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/ppc-corenet-cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-10-03 10:58:18 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-15 18:50:26 -0400
commitdc2398d7ff282bce5a348481024e41f96e40e854 (patch)
tree1d57fa7cf9ebdc043562f5371e1fb18d8a545bdd /drivers/cpufreq/ppc-corenet-cpufreq.c
parentd63bd27fe953daa402a108e141c36dcc59c6931c (diff)
cpufreq: ppc-corenet: 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 ppc-corenet 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/ppc-corenet-cpufreq.c')
-rw-r--r--drivers/cpufreq/ppc-corenet-cpufreq.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c
index 5716b44ffc0d..befd489314e8 100644
--- a/drivers/cpufreq/ppc-corenet-cpufreq.c
+++ b/drivers/cpufreq/ppc-corenet-cpufreq.c
@@ -252,14 +252,6 @@ static int __exit corenet_cpufreq_cpu_exit(struct cpufreq_policy *policy)
252 return 0; 252 return 0;
253} 253}
254 254
255static int corenet_cpufreq_verify(struct cpufreq_policy *policy)
256{
257 struct cpufreq_frequency_table *table =
258 per_cpu(cpu_data, policy->cpu)->table;
259
260 return cpufreq_frequency_table_verify(policy, table);
261}
262
263static int corenet_cpufreq_target(struct cpufreq_policy *policy, 255static int corenet_cpufreq_target(struct cpufreq_policy *policy,
264 unsigned int target_freq, unsigned int relation) 256 unsigned int target_freq, unsigned int relation)
265{ 257{
@@ -292,20 +284,15 @@ static int corenet_cpufreq_target(struct cpufreq_policy *policy,
292 return ret; 284 return ret;
293} 285}
294 286
295static struct freq_attr *corenet_cpufreq_attr[] = {
296 &cpufreq_freq_attr_scaling_available_freqs,
297 NULL,
298};
299
300static struct cpufreq_driver ppc_corenet_cpufreq_driver = { 287static struct cpufreq_driver ppc_corenet_cpufreq_driver = {
301 .name = "ppc_cpufreq", 288 .name = "ppc_cpufreq",
302 .flags = CPUFREQ_CONST_LOOPS, 289 .flags = CPUFREQ_CONST_LOOPS,
303 .init = corenet_cpufreq_cpu_init, 290 .init = corenet_cpufreq_cpu_init,
304 .exit = __exit_p(corenet_cpufreq_cpu_exit), 291 .exit = __exit_p(corenet_cpufreq_cpu_exit),
305 .verify = corenet_cpufreq_verify, 292 .verify = cpufreq_generic_frequency_table_verify,
306 .target = corenet_cpufreq_target, 293 .target = corenet_cpufreq_target,
307 .get = corenet_cpufreq_get_speed, 294 .get = corenet_cpufreq_get_speed,
308 .attr = corenet_cpufreq_attr, 295 .attr = cpufreq_generic_attr,
309}; 296};
310 297
311static const struct of_device_id node_matches[] __initdata = { 298static const struct of_device_id node_matches[] __initdata = {