提交 e9f51837 编写于 作者: V Viresh Kumar 提交者: Rafael J. Wysocki

cpufreq: Don't check if cpu is online/offline for cpufreq callbacks

cpufreq layer doesn't call cpufreq driver's callback for any offline
CPU and so checking that isn't useful.

Lets get rid of it.
Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 b43a7ffb
...@@ -61,9 +61,6 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy, ...@@ -61,9 +61,6 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy,
struct cpufreq_freqs freqs; struct cpufreq_freqs freqs;
unsigned int freq; unsigned int freq;
if (!cpu_online(cpu))
return -ENODEV;
cpus_allowed = current->cpus_allowed; cpus_allowed = current->cpus_allowed;
set_cpus_allowed_ptr(current, cpumask_of(cpu)); set_cpus_allowed_ptr(current, cpumask_of(cpu));
...@@ -109,9 +106,6 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -109,9 +106,6 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
unsigned long rate; unsigned long rate;
int ret; int ret;
if (!cpu_online(policy->cpu))
return -ENODEV;
cpuclk = clk_get(NULL, "cpu_clk"); cpuclk = clk_get(NULL, "cpu_clk");
if (IS_ERR(cpuclk)) { if (IS_ERR(cpuclk)) {
printk(KERN_ERR "cpufreq: couldn't get CPU clk\n"); printk(KERN_ERR "cpufreq: couldn't get CPU clk\n");
......
...@@ -51,9 +51,6 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy, ...@@ -51,9 +51,6 @@ static int sh_cpufreq_target(struct cpufreq_policy *policy,
struct device *dev; struct device *dev;
long freq; long freq;
if (!cpu_online(cpu))
return -ENODEV;
cpus_allowed = current->cpus_allowed; cpus_allowed = current->cpus_allowed;
set_cpus_allowed_ptr(current, cpumask_of(cpu)); set_cpus_allowed_ptr(current, cpumask_of(cpu));
...@@ -111,9 +108,6 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -111,9 +108,6 @@ static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy)
struct cpufreq_frequency_table *freq_table; struct cpufreq_frequency_table *freq_table;
struct device *dev; struct device *dev;
if (!cpu_online(cpu))
return -ENODEV;
dev = get_cpu_device(cpu); dev = get_cpu_device(cpu);
cpuclk = clk_get(dev, "cpu_clk"); cpuclk = clk_get(dev, "cpu_clk");
......
...@@ -234,9 +234,6 @@ static unsigned int us2e_freq_get(unsigned int cpu) ...@@ -234,9 +234,6 @@ static unsigned int us2e_freq_get(unsigned int cpu)
cpumask_t cpus_allowed; cpumask_t cpus_allowed;
unsigned long clock_tick, estar; unsigned long clock_tick, estar;
if (!cpu_online(cpu))
return 0;
cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current)); cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
set_cpus_allowed_ptr(current, cpumask_of(cpu)); set_cpus_allowed_ptr(current, cpumask_of(cpu));
...@@ -257,9 +254,6 @@ static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy, ...@@ -257,9 +254,6 @@ static void us2e_set_cpu_divider_index(struct cpufreq_policy *policy,
cpumask_t cpus_allowed; cpumask_t cpus_allowed;
struct cpufreq_freqs freqs; struct cpufreq_freqs freqs;
if (!cpu_online(cpu))
return;
cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current)); cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
set_cpus_allowed_ptr(current, cpumask_of(cpu)); set_cpus_allowed_ptr(current, cpumask_of(cpu));
......
...@@ -82,9 +82,6 @@ static unsigned int us3_freq_get(unsigned int cpu) ...@@ -82,9 +82,6 @@ static unsigned int us3_freq_get(unsigned int cpu)
unsigned long reg; unsigned long reg;
unsigned int ret; unsigned int ret;
if (!cpu_online(cpu))
return 0;
cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current)); cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
set_cpus_allowed_ptr(current, cpumask_of(cpu)); set_cpus_allowed_ptr(current, cpumask_of(cpu));
...@@ -104,9 +101,6 @@ static void us3_set_cpu_divider_index(struct cpufreq_policy *policy, ...@@ -104,9 +101,6 @@ static void us3_set_cpu_divider_index(struct cpufreq_policy *policy,
cpumask_t cpus_allowed; cpumask_t cpus_allowed;
struct cpufreq_freqs freqs; struct cpufreq_freqs freqs;
if (!cpu_online(cpu))
return;
cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current)); cpumask_copy(&cpus_allowed, tsk_cpus_allowed(current));
set_cpus_allowed_ptr(current, cpumask_of(cpu)); set_cpus_allowed_ptr(current, cpumask_of(cpu));
......
...@@ -58,8 +58,7 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate) ...@@ -58,8 +58,7 @@ static int cpufreq_p4_setdc(unsigned int cpu, unsigned int newstate)
{ {
u32 l, h; u32 l, h;
if (!cpu_online(cpu) || if ((newstate > DC_DISABLE) || (newstate == DC_RESV))
(newstate > DC_DISABLE) || (newstate == DC_RESV))
return -EINVAL; return -EINVAL;
rdmsr_on_cpu(cpu, MSR_IA32_THERM_STATUS, &l, &h); rdmsr_on_cpu(cpu, MSR_IA32_THERM_STATUS, &l, &h);
......
...@@ -1102,9 +1102,6 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) ...@@ -1102,9 +1102,6 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
struct init_on_cpu init_on_cpu; struct init_on_cpu init_on_cpu;
int rc; int rc;
if (!cpu_online(pol->cpu))
return -ENODEV;
smp_call_function_single(pol->cpu, check_supported_cpu, &rc, 1); smp_call_function_single(pol->cpu, check_supported_cpu, &rc, 1);
if (rc) if (rc)
return -ENODEV; return -ENODEV;
......
...@@ -481,10 +481,6 @@ static int centrino_target (struct cpufreq_policy *policy, ...@@ -481,10 +481,6 @@ static int centrino_target (struct cpufreq_policy *policy,
for_each_cpu(j, policy->cpus) { for_each_cpu(j, policy->cpus) {
int good_cpu; int good_cpu;
/* cpufreq holds the hotplug lock, so we are safe here */
if (!cpu_online(j))
continue;
/* /*
* Support for SMP systems. * Support for SMP systems.
* Make sure we are running on CPU that wants to change freq * Make sure we are running on CPU that wants to change freq
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册