aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/freq_table.c
diff options
context:
space:
mode:
authorMike Travis <travis@sgi.com>2008-03-25 18:06:53 -0400
committerDave Jones <davej@redhat.com>2008-05-19 18:17:49 -0400
commit7a6aedfac98c6d54ecf97ca1ffb1e6a1f3d26aea (patch)
tree404f941cae556ce45b53c90bb4192d9fb53bd233 /drivers/cpufreq/freq_table.c
parent860da5e578c25d1ab4528c0d1ad13f9969e3490f (diff)
[CPUFREQ] change cpu freq arrays to per_cpu variables
Change cpufreq_policy and cpufreq_governor pointer tables from arrays to per_cpu variables in the cpufreq subsystem. Also some minor complaints from checkpatch.pl fixed. Based on: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq/freq_table.c')
-rw-r--r--drivers/cpufreq/freq_table.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index ae6cd60d5c14..fe485c9515d1 100644
--- a/drivers/cpufreq/freq_table.c
+++ b/drivers/cpufreq/freq_table.c
@@ -169,7 +169,7 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
169} 169}
170EXPORT_SYMBOL_GPL(cpufreq_frequency_table_target); 170EXPORT_SYMBOL_GPL(cpufreq_frequency_table_target);
171 171
172static struct cpufreq_frequency_table *show_table[NR_CPUS]; 172static DEFINE_PER_CPU(struct cpufreq_frequency_table *, show_table);
173/** 173/**
174 * show_available_freqs - show available frequencies for the specified CPU 174 * show_available_freqs - show available frequencies for the specified CPU
175 */ 175 */
@@ -180,10 +180,10 @@ static ssize_t show_available_freqs (struct cpufreq_policy *policy, char *buf)
180 ssize_t count = 0; 180 ssize_t count = 0;
181 struct cpufreq_frequency_table *table; 181 struct cpufreq_frequency_table *table;
182 182
183 if (!show_table[cpu]) 183 if (!per_cpu(show_table, cpu))
184 return -ENODEV; 184 return -ENODEV;
185 185
186 table = show_table[cpu]; 186 table = per_cpu(show_table, cpu);
187 187
188 for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) { 188 for (i=0; (table[i].frequency != CPUFREQ_TABLE_END); i++) {
189 if (table[i].frequency == CPUFREQ_ENTRY_INVALID) 189 if (table[i].frequency == CPUFREQ_ENTRY_INVALID)
@@ -212,20 +212,20 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
212 unsigned int cpu) 212 unsigned int cpu)
213{ 213{
214 dprintk("setting show_table for cpu %u to %p\n", cpu, table); 214 dprintk("setting show_table for cpu %u to %p\n", cpu, table);
215 show_table[cpu] = table; 215 per_cpu(show_table, cpu) = table;
216} 216}
217EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr); 217EXPORT_SYMBOL_GPL(cpufreq_frequency_table_get_attr);
218 218
219void cpufreq_frequency_table_put_attr(unsigned int cpu) 219void cpufreq_frequency_table_put_attr(unsigned int cpu)
220{ 220{
221 dprintk("clearing show_table for cpu %u\n", cpu); 221 dprintk("clearing show_table for cpu %u\n", cpu);
222 show_table[cpu] = NULL; 222 per_cpu(show_table, cpu) = NULL;
223} 223}
224EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr); 224EXPORT_SYMBOL_GPL(cpufreq_frequency_table_put_attr);
225 225
226struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu) 226struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu)
227{ 227{
228 return show_table[cpu]; 228 return per_cpu(show_table, cpu);
229} 229}
230EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table); 230EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table);
231 231