aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-10-03 10:58:10 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-15 18:50:25 -0400
commit3a4d0342ebada05810a2400ef1db3c66d88ef22c (patch)
treecb6b9ebc8d17b513a1d04c00d86bde4a32ec8141
parenta86a41a13e7971c85a6dc2c6865ff7747397ef21 (diff)
cpufreq: longhaul: 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 longhaul driver. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/longhaul.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c
index 70b66fda3cad..57d7b02f863a 100644
--- a/drivers/cpufreq/longhaul.c
+++ b/drivers/cpufreq/longhaul.c
@@ -625,12 +625,6 @@ static void longhaul_setup_voltagescaling(void)
625} 625}
626 626
627 627
628static int longhaul_verify(struct cpufreq_policy *policy)
629{
630 return cpufreq_frequency_table_verify(policy, longhaul_table);
631}
632
633
634static int longhaul_target(struct cpufreq_policy *policy, 628static int longhaul_target(struct cpufreq_policy *policy,
635 unsigned int target_freq, unsigned int relation) 629 unsigned int target_freq, unsigned int relation)
636{ 630{
@@ -924,25 +918,14 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy)
924 return cpufreq_table_validate_and_show(policy, longhaul_table); 918 return cpufreq_table_validate_and_show(policy, longhaul_table);
925} 919}
926 920
927static int longhaul_cpu_exit(struct cpufreq_policy *policy)
928{
929 cpufreq_frequency_table_put_attr(policy->cpu);
930 return 0;
931}
932
933static struct freq_attr *longhaul_attr[] = {
934 &cpufreq_freq_attr_scaling_available_freqs,
935 NULL,
936};
937
938static struct cpufreq_driver longhaul_driver = { 921static struct cpufreq_driver longhaul_driver = {
939 .verify = longhaul_verify, 922 .verify = cpufreq_generic_frequency_table_verify,
940 .target = longhaul_target, 923 .target = longhaul_target,
941 .get = longhaul_get, 924 .get = longhaul_get,
942 .init = longhaul_cpu_init, 925 .init = longhaul_cpu_init,
943 .exit = longhaul_cpu_exit, 926 .exit = cpufreq_generic_exit,
944 .name = "longhaul", 927 .name = "longhaul",
945 .attr = longhaul_attr, 928 .attr = cpufreq_generic_attr,
946}; 929};
947 930
948static const struct x86_cpu_id longhaul_id[] = { 931static const struct x86_cpu_id longhaul_id[] = {