aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/us3_cpufreq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/us3_cpufreq.c')
-rw-r--r--arch/sparc/kernel/us3_cpufreq.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/sparc/kernel/us3_cpufreq.c b/arch/sparc/kernel/us3_cpufreq.c
index eb1624b931d9..7ceb9c8458f0 100644
--- a/arch/sparc/kernel/us3_cpufreq.c
+++ b/arch/sparc/kernel/us3_cpufreq.c
@@ -96,8 +96,10 @@ static unsigned int us3_freq_get(unsigned int cpu)
96 return ret; 96 return ret;
97} 97}
98 98
99static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index) 99static void us3_set_cpu_divider_index(struct cpufreq_policy *policy,
100 unsigned int index)
100{ 101{
102 unsigned int cpu = policy->cpu;
101 unsigned long new_bits, new_freq, reg; 103 unsigned long new_bits, new_freq, reg;
102 cpumask_t cpus_allowed; 104 cpumask_t cpus_allowed;
103 struct cpufreq_freqs freqs; 105 struct cpufreq_freqs freqs;
@@ -131,14 +133,13 @@ static void us3_set_cpu_divider_index(unsigned int cpu, unsigned int index)
131 133
132 freqs.old = get_current_freq(cpu, reg); 134 freqs.old = get_current_freq(cpu, reg);
133 freqs.new = new_freq; 135 freqs.new = new_freq;
134 freqs.cpu = cpu; 136 cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE);
135 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
136 137
137 reg &= ~SAFARI_CFG_DIV_MASK; 138 reg &= ~SAFARI_CFG_DIV_MASK;
138 reg |= new_bits; 139 reg |= new_bits;
139 write_safari_cfg(reg); 140 write_safari_cfg(reg);
140 141
141 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 142 cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE);
142 143
143 set_cpus_allowed_ptr(current, &cpus_allowed); 144 set_cpus_allowed_ptr(current, &cpus_allowed);
144} 145}
@@ -156,7 +157,7 @@ static int us3_freq_target(struct cpufreq_policy *policy,
156 &new_index)) 157 &new_index))
157 return -EINVAL; 158 return -EINVAL;
158 159
159 us3_set_cpu_divider_index(policy->cpu, new_index); 160 us3_set_cpu_divider_index(policy, new_index);
160 161
161 return 0; 162 return 0;
162} 163}
@@ -192,7 +193,7 @@ static int __init us3_freq_cpu_init(struct cpufreq_policy *policy)
192static int us3_freq_cpu_exit(struct cpufreq_policy *policy) 193static int us3_freq_cpu_exit(struct cpufreq_policy *policy)
193{ 194{
194 if (cpufreq_us3_driver) 195 if (cpufreq_us3_driver)
195 us3_set_cpu_divider_index(policy->cpu, 0); 196 us3_set_cpu_divider_index(policy, 0);
196 197
197 return 0; 198 return 0;
198} 199}