diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-01-29 15:39:08 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-02-02 00:01:16 +0100 |
commit | fcf8058296edbc3de43adf095824fc32b067b9f8 (patch) | |
tree | 7f290019ecffbe50af0f4012eeadf4f08e162bb3 /drivers/cpufreq/spear-cpufreq.c | |
parent | cpufreq: Revert "cpufreq: Don't use cpu removed during cpufreq_driver_unregis... (diff) | |
download | linux-fcf8058296edbc3de43adf095824fc32b067b9f8.tar.xz linux-fcf8058296edbc3de43adf095824fc32b067b9f8.zip |
cpufreq: Simplify cpufreq_add_dev()
Currently cpufreq_add_dev() firsts allocates policy, calls
driver->init() and then checks if this CPU is already managed or not.
And if it is already managed, its policy is freed.
We can save all this if we somehow know that CPU is managed or not in
advance. policy->related_cpus contains the list of all valid sibling
CPUs of policy->cpu. We can check this to see if the current CPU is
already managed.
From now on, platforms don't really need to set related_cpus from
their init() routines, as the same work is done by core too.
If a platform driver needs to set the related_cpus mask with some
additional CPUs, other than CPUs present in policy->cpus, they are
free to do it, though, as we don't override anything.
[rjw: Changelog]
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/spear-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/spear-cpufreq.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 8ff26af622ea..fc714a65fa15 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c @@ -189,7 +189,6 @@ static int spear_cpufreq_init(struct cpufreq_policy *policy) policy->cur = spear_cpufreq_get(0); cpumask_copy(policy->cpus, topology_core_cpumask(policy->cpu)); - cpumask_copy(policy->related_cpus, policy->cpus); return 0; } |