Commit 4459527d authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Remove notify in speedstep_set_state [2/2]

Signed-off-by: default avatarBruno Ducrot <ducrot@poupinou.org>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent e4b509c4
......@@ -145,31 +145,18 @@ static int speedstep_get_state (void)
/**
* speedstep_set_state - set the SpeedStep state
* @state: new processor frequency state (SPEEDSTEP_LOW or SPEEDSTEP_HIGH)
* @notify: whether to call cpufreq_notify_transition
*
*/
static void speedstep_set_state (unsigned int state, unsigned int notify)
static void speedstep_set_state (unsigned int state)
{
unsigned int old_state, result = 0, command, new_state;
unsigned int result = 0, command, new_state;
unsigned long flags;
struct cpufreq_freqs freqs;
unsigned int function=SET_SPEEDSTEP_STATE;
unsigned int retry = 0;
if (state > 0x1)
return;
old_state = speedstep_get_state();
freqs.old = speedstep_freqs[old_state].frequency;
freqs.new = speedstep_freqs[state].frequency;
freqs.cpu = 0; /* speedstep.c is UP only driver */
if (old_state == state)
return;
if (notify)
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
/* Disable IRQs */
local_irq_save(flags);
......@@ -198,9 +185,6 @@ static void speedstep_set_state (unsigned int state, unsigned int notify)
printk(KERN_ERR "cpufreq: change failed with new_state %u and result %u\n", new_state, result);
}
if (notify)
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return;
}
......@@ -217,11 +201,21 @@ static int speedstep_target (struct cpufreq_policy *policy,
unsigned int target_freq, unsigned int relation)
{
unsigned int newstate = 0;
struct cpufreq_freqs freqs;
if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
return -EINVAL;
speedstep_set_state(newstate, 1);
freqs.old = speedstep_freqs[speedstep_get_state()].frequency;
freqs.new = speedstep_freqs[newstate].frequency;
freqs.cpu = 0; /* speedstep.c is UP only driver */
if (freqs.old == freqs.new)
return 0;
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
speedstep_set_state(newstate);
cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
return 0;
}
......
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