diff options
Diffstat (limited to 'drivers/cpufreq/sh-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/sh-cpufreq.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/cpufreq/sh-cpufreq.c b/drivers/cpufreq/sh-cpufreq.c index ffc6d24b0cfb..387af12503a6 100644 --- a/drivers/cpufreq/sh-cpufreq.c +++ b/drivers/cpufreq/sh-cpufreq.c | |||
@@ -87,15 +87,12 @@ static int sh_cpufreq_verify(struct cpufreq_policy *policy) | |||
87 | if (freq_table) | 87 | if (freq_table) |
88 | return cpufreq_frequency_table_verify(policy, freq_table); | 88 | return cpufreq_frequency_table_verify(policy, freq_table); |
89 | 89 | ||
90 | cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, | 90 | cpufreq_verify_within_cpu_limits(policy); |
91 | policy->cpuinfo.max_freq); | ||
92 | 91 | ||
93 | policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000; | 92 | policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000; |
94 | policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; | 93 | policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; |
95 | 94 | ||
96 | cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, | 95 | cpufreq_verify_within_cpu_limits(policy); |
97 | policy->cpuinfo.max_freq); | ||
98 | |||
99 | return 0; | 96 | return 0; |
100 | } | 97 | } |
101 | 98 | ||
@@ -114,15 +111,13 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
114 | return PTR_ERR(cpuclk); | 111 | return PTR_ERR(cpuclk); |
115 | } | 112 | } |
116 | 113 | ||
117 | policy->cur = sh_cpufreq_get(cpu); | ||
118 | |||
119 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; | 114 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; |
120 | if (freq_table) { | 115 | if (freq_table) { |
121 | int result; | 116 | int result; |
122 | 117 | ||
123 | result = cpufreq_frequency_table_cpuinfo(policy, freq_table); | 118 | result = cpufreq_table_validate_and_show(policy, freq_table); |
124 | if (!result) | 119 | if (result) |
125 | cpufreq_frequency_table_get_attr(freq_table, cpu); | 120 | return result; |
126 | } else { | 121 | } else { |
127 | dev_notice(dev, "no frequency table found, falling back " | 122 | dev_notice(dev, "no frequency table found, falling back " |
128 | "to rate rounding.\n"); | 123 | "to rate rounding.\n"); |
@@ -154,11 +149,6 @@ static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy) | |||
154 | return 0; | 149 | return 0; |
155 | } | 150 | } |
156 | 151 | ||
157 | static struct freq_attr *sh_freq_attr[] = { | ||
158 | &cpufreq_freq_attr_scaling_available_freqs, | ||
159 | NULL, | ||
160 | }; | ||
161 | |||
162 | static struct cpufreq_driver sh_cpufreq_driver = { | 152 | static struct cpufreq_driver sh_cpufreq_driver = { |
163 | .name = "sh", | 153 | .name = "sh", |
164 | .get = sh_cpufreq_get, | 154 | .get = sh_cpufreq_get, |
@@ -166,7 +156,7 @@ static struct cpufreq_driver sh_cpufreq_driver = { | |||
166 | .verify = sh_cpufreq_verify, | 156 | .verify = sh_cpufreq_verify, |
167 | .init = sh_cpufreq_cpu_init, | 157 | .init = sh_cpufreq_cpu_init, |
168 | .exit = sh_cpufreq_cpu_exit, | 158 | .exit = sh_cpufreq_cpu_exit, |
169 | .attr = sh_freq_attr, | 159 | .attr = cpufreq_generic_attr, |
170 | }; | 160 | }; |
171 | 161 | ||
172 | static int __init sh_cpufreq_module_init(void) | 162 | static int __init sh_cpufreq_module_init(void) |