Commit 6c7b6c0c authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[CPUFREQ] Better fix for previous speedstep-ich breakage.

Do away with the prototype by just moving some code around.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 4c82f811
......@@ -64,8 +64,6 @@ static struct cpufreq_frequency_table speedstep_freqs[] = {
#endif
static unsigned int speedstep_get(unsigned int cpu);
/**
* speedstep_set_state - set the SpeedStep state
* @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
......@@ -228,6 +226,23 @@ static unsigned int speedstep_detect_chipset (void)
return 0;
}
static unsigned int speedstep_get(unsigned int cpu)
{
unsigned int speed;
cpumask_t cpus_allowed,affected_cpu_map;
/* only run on CPU to be set, or on its sibling */
cpus_allowed = current->cpus_allowed;
#ifdef CONFIG_SMP
affected_cpu_map = cpu_sibling_map[cpu];
#else
affected_cpu_map = cpumask_of_cpu(cpu);
#endif
set_cpus_allowed(current, affected_cpu_map);
speed=speedstep_get_processor_frequency(speedstep_processor);
set_cpus_allowed(current, cpus_allowed);
return speed;
}
/**
* speedstep_target - set a new CPUFreq policy
......@@ -361,24 +376,6 @@ static int speedstep_cpu_exit(struct cpufreq_policy *policy)
return 0;
}
static unsigned int speedstep_get(unsigned int cpu)
{
unsigned int speed;
cpumask_t cpus_allowed,affected_cpu_map;
/* only run on CPU to be set, or on its sibling */
cpus_allowed = current->cpus_allowed;
#ifdef CONFIG_SMP
affected_cpu_map = cpu_sibling_map[cpu];
#else
affected_cpu_map = cpumask_of_cpu(cpu);
#endif
set_cpus_allowed(current, affected_cpu_map);
speed=speedstep_get_processor_frequency(speedstep_processor);
set_cpus_allowed(current, cpus_allowed);
return speed;
}
static struct freq_attr* speedstep_attr[] = {
&cpufreq_freq_attr_scaling_available_freqs,
NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment