aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/sparc-us2e-cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/sparc-us2e-cpufreq.c')
-rw-r--r--drivers/cpufreq/sparc-us2e-cpufreq.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/cpufreq/sparc-us2e-cpufreq.c b/drivers/cpufreq/sparc-us2e-cpufreq.c
index 291688c1da9a..3bf5b8f03661 100644
--- a/drivers/cpufreq/sparc-us2e-cpufreq.c
+++ b/drivers/cpufreq/sparc-us2e-cpufreq.c
@@ -245,8 +245,7 @@ static unsigned int us2e_freq_get(unsigned int cpu)
245 return clock_tick / estar_to_divisor(estar); 245 return clock_tick / estar_to_divisor(estar);
246} 246}
247 247
248static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy, 248static int us2e_freq_target(struct cpufreq_policy *policy, unsigned int index)
249 unsigned int index)
250{ 249{
251 unsigned int cpu = policy->cpu; 250 unsigned int cpu = policy->cpu;
252 unsigned long new_bits, new_freq; 251 unsigned long new_bits, new_freq;
@@ -277,20 +276,6 @@ static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy,
277 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); 276 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
278 277
279 set_cpus_allowed_ptr(current, &cpus_allowed); 278 set_cpus_allowed_ptr(current, &cpus_allowed);
280}
281
282static int us2e_freq_target(struct cpufreq_policy *policy,
283 unsigned int target_freq,
284 unsigned int relation)
285{
286 unsigned int new_index = 0;
287
288 if (cpufreq_frequency_table_target(policy,
289 &us2e_freq_table[policy->cpu].table[0],
290 target_freq, relation, &new_index))
291 return -EINVAL;
292
293 us2e_set_cpu_divider_index(policy, new_index);
294 279
295 return 0; 280 return 0;
296} 281}
@@ -325,7 +310,7 @@ static int us2e_freq_cpu_exit(struct cpufreq_policy *policy)
325{ 310{
326 if (cpufreq_us2e_driver) { 311 if (cpufreq_us2e_driver) {
327 cpufreq_frequency_table_put_attr(policy->cpu); 312 cpufreq_frequency_table_put_attr(policy->cpu);
328 us2e_set_cpu_divider_index(policy, 0); 313 us2e_freq_target(policy, 0);
329 } 314 }
330 315
331 return 0; 316 return 0;
@@ -358,7 +343,7 @@ static int __init us2e_freq_init(void)
358 343
359 driver->init = us2e_freq_cpu_init; 344 driver->init = us2e_freq_cpu_init;
360 driver->verify = cpufreq_generic_frequency_table_verify; 345 driver->verify = cpufreq_generic_frequency_table_verify;
361 driver->target = us2e_freq_target; 346 driver->target_index = us2e_freq_target;
362 driver->get = us2e_freq_get; 347 driver->get = us2e_freq_get;
363 driver->exit = us2e_freq_cpu_exit; 348 driver->exit = us2e_freq_cpu_exit;
364 strcpy(driver->name, "UltraSPARC-IIe"); 349 strcpy(driver->name, "UltraSPARC-IIe");