Commit 123c66ee authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[PATCH] cpufreq: deprecated usage of CPUFREQ_ALL_CPUS

The usage of CPUFREQ_ALL_CPUS is deprecated. Only exception is cpufreq_set,
which needs to iterate over all CPUS now. Also, remove some unneeded code.
parent 86005b89
...@@ -124,7 +124,7 @@ static void elanfreq_set_cpu_state (unsigned int state) { ...@@ -124,7 +124,7 @@ static void elanfreq_set_cpu_state (unsigned int state) {
freqs.old = elanfreq_get_cpu_frequency(); freqs.old = elanfreq_get_cpu_frequency();
freqs.new = elan_multiplier[state].clock; freqs.new = elan_multiplier[state].clock;
freqs.cpu = CPUFREQ_ALL_CPUS; /* elanfreq.c is UP only driver */ freqs.cpu = 0; /* elanfreq.c is UP only driver */
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
......
...@@ -315,7 +315,7 @@ static void longhaul_setstate (unsigned int clock_ratio_index, unsigned int newf ...@@ -315,7 +315,7 @@ static void longhaul_setstate (unsigned int clock_ratio_index, unsigned int newf
freqs.old = longhaul_get_cpu_mult() * longhaul_get_cpu_fsb() * 100; freqs.old = longhaul_get_cpu_mult() * longhaul_get_cpu_fsb() * 100;
freqs.new = clock_ratio[clock_ratio_index] * newfsb * 100; freqs.new = clock_ratio[clock_ratio_index] * newfsb * 100;
freqs.cpu = CPUFREQ_ALL_CPUS; /* longhaul.c is UP only driver */ freqs.cpu = 0; /* longhaul.c is UP only driver */
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
......
...@@ -83,7 +83,7 @@ static void powernow_k6_set_state (unsigned int best_i) ...@@ -83,7 +83,7 @@ static void powernow_k6_set_state (unsigned int best_i)
freqs.old = busfreq * powernow_k6_get_cpu_multiplier(); freqs.old = busfreq * powernow_k6_get_cpu_multiplier();
freqs.new = busfreq * clock_ratio[best_i]; freqs.new = busfreq * clock_ratio[best_i];
freqs.cpu = CPUFREQ_ALL_CPUS; /* powernow-k6.c is UP only driver */ freqs.cpu = 0; /* powernow-k6.c is UP only driver */
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
......
...@@ -154,7 +154,7 @@ static void speedstep_set_state (unsigned int state, int notify) ...@@ -154,7 +154,7 @@ static void speedstep_set_state (unsigned int state, int notify)
freqs.old = (oldstate == SPEEDSTEP_HIGH) ? speedstep_high_freq : speedstep_low_freq; freqs.old = (oldstate == SPEEDSTEP_HIGH) ? speedstep_high_freq : speedstep_low_freq;
freqs.new = (state == SPEEDSTEP_HIGH) ? speedstep_high_freq : speedstep_low_freq; freqs.new = (state == SPEEDSTEP_HIGH) ? speedstep_high_freq : speedstep_low_freq;
freqs.cpu = CPUFREQ_ALL_CPUS; /* speedstep.c is UP only driver */ freqs.cpu = 0; /* speedstep.c is UP only driver */
if (notify) if (notify)
cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
......
...@@ -103,14 +103,6 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mu ...@@ -103,14 +103,6 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mu
}; };
/*********************************************************************
* DYNAMIC CPUFREQ INTERFACE *
*********************************************************************/
#ifdef CONFIG_CPU_FREQ_DYNAMIC
/* TBD */
#endif /* CONFIG_CPU_FREQ_DYNAMIC */
/********************************************************************* /*********************************************************************
* CPUFREQ DRIVER INTERFACE * * CPUFREQ DRIVER INTERFACE *
*********************************************************************/ *********************************************************************/
...@@ -122,9 +114,6 @@ struct cpufreq_driver { ...@@ -122,9 +114,6 @@ struct cpufreq_driver {
cpufreq_policy_t verify; cpufreq_policy_t verify;
cpufreq_policy_t setpolicy; cpufreq_policy_t setpolicy;
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
#ifdef CONFIG_CPU_FREQ_DYNAMIC
/* TBD */
#endif
/* 2.4. compatible API */ /* 2.4. compatible API */
#ifdef CONFIG_CPU_FREQ_24_API #ifdef CONFIG_CPU_FREQ_24_API
unsigned int cpu_cur_freq[NR_CPUS]; unsigned int cpu_cur_freq[NR_CPUS];
......
...@@ -365,7 +365,7 @@ int cpufreq_set(unsigned int freq, unsigned int cpu) ...@@ -365,7 +365,7 @@ int cpufreq_set(unsigned int freq, unsigned int cpu)
{ {
struct cpufreq_policy policy; struct cpufreq_policy policy;
down(&cpufreq_driver_sem); down(&cpufreq_driver_sem);
if (!cpufreq_driver || !cpu_max_freq) { if (!cpufreq_driver || !freq || (cpu > NR_CPUS)) {
up(&cpufreq_driver_sem); up(&cpufreq_driver_sem);
return -EINVAL; return -EINVAL;
} }
...@@ -377,6 +377,19 @@ int cpufreq_set(unsigned int freq, unsigned int cpu) ...@@ -377,6 +377,19 @@ int cpufreq_set(unsigned int freq, unsigned int cpu)
up(&cpufreq_driver_sem); up(&cpufreq_driver_sem);
if (policy.cpu == CPUFREQ_ALL_CPUS)
{
unsigned int i;
unsigned int ret = 0;
for (i=0; i<NR_CPUS; i++)
{
policy.cpu = i;
if (cpu_online(i))
ret |= cpufreq_set_policy(&policy);
}
return ret;
}
else
return cpufreq_set_policy(&policy); return cpufreq_set_policy(&policy);
} }
EXPORT_SYMBOL_GPL(cpufreq_set); EXPORT_SYMBOL_GPL(cpufreq_set);
...@@ -842,7 +855,6 @@ EXPORT_SYMBOL(cpufreq_get_policy); ...@@ -842,7 +855,6 @@ EXPORT_SYMBOL(cpufreq_get_policy);
*/ */
int cpufreq_set_policy(struct cpufreq_policy *policy) int cpufreq_set_policy(struct cpufreq_policy *policy)
{ {
unsigned int i;
int ret; int ret;
down(&cpufreq_driver_sem); down(&cpufreq_driver_sem);
...@@ -889,23 +901,11 @@ int cpufreq_set_policy(struct cpufreq_policy *policy) ...@@ -889,23 +901,11 @@ int cpufreq_set_policy(struct cpufreq_policy *policy)
up(&cpufreq_notifier_sem); up(&cpufreq_notifier_sem);
if (policy->cpu == CPUFREQ_ALL_CPUS) {
for (i=0;i<NR_CPUS;i++) {
cpufreq_driver->policy[i].min = policy->min;
cpufreq_driver->policy[i].max = policy->max;
cpufreq_driver->policy[i].policy = policy->policy;
}
} else {
cpufreq_driver->policy[policy->cpu].min = policy->min; cpufreq_driver->policy[policy->cpu].min = policy->min;
cpufreq_driver->policy[policy->cpu].max = policy->max; cpufreq_driver->policy[policy->cpu].max = policy->max;
cpufreq_driver->policy[policy->cpu].policy = policy->policy; cpufreq_driver->policy[policy->cpu].policy = policy->policy;
}
#ifdef CONFIG_CPU_FREQ_24_API #ifdef CONFIG_CPU_FREQ_24_API
if (policy->cpu == CPUFREQ_ALL_CPUS) {
for (i=0;i<NR_CPUS;i++)
cpu_cur_freq[i] = policy->max;
} else
cpu_cur_freq[policy->cpu] = policy->max; cpu_cur_freq[policy->cpu] = policy->max;
#endif #endif
...@@ -919,15 +919,6 @@ EXPORT_SYMBOL(cpufreq_set_policy); ...@@ -919,15 +919,6 @@ EXPORT_SYMBOL(cpufreq_set_policy);
/*********************************************************************
* DYNAMIC CPUFREQ SWITCHING *
*********************************************************************/
#ifdef CONFIG_CPU_FREQ_DYNAMIC
/* TBD */
#endif /* CONFIG_CPU_FREQ_DYNAMIC */
/********************************************************************* /*********************************************************************
* EXTERNALLY AFFECTING FREQUENCY CHANGES * * EXTERNALLY AFFECTING FREQUENCY CHANGES *
*********************************************************************/ *********************************************************************/
...@@ -967,11 +958,6 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state) ...@@ -967,11 +958,6 @@ void cpufreq_notify_transition(struct cpufreq_freqs *freqs, unsigned int state)
adjust_jiffies(CPUFREQ_POSTCHANGE, freqs); adjust_jiffies(CPUFREQ_POSTCHANGE, freqs);
notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_POSTCHANGE, freqs); notifier_call_chain(&cpufreq_transition_notifier_list, CPUFREQ_POSTCHANGE, freqs);
#ifdef CONFIG_CPU_FREQ_24_API #ifdef CONFIG_CPU_FREQ_24_API
if (freqs->cpu == CPUFREQ_ALL_CPUS) {
int i;
for (i=0;i<NR_CPUS;i++)
cpu_cur_freq[i] = freqs->new;
} else
cpu_cur_freq[freqs->cpu] = freqs->new; cpu_cur_freq[freqs->cpu] = freqs->new;
#endif #endif
break; break;
......
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