Commit 86372d54 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Fix locking [8/11]

Split up cpufreq_governor into a locking and non-locking variant.
parent e45335e8
...@@ -608,15 +608,9 @@ int cpufreq_driver_target(struct cpufreq_policy *policy, ...@@ -608,15 +608,9 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
EXPORT_SYMBOL_GPL(cpufreq_driver_target); EXPORT_SYMBOL_GPL(cpufreq_driver_target);
int cpufreq_governor(unsigned int cpu, unsigned int event) static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event)
{ {
int ret = 0; int ret = 0;
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
if (!policy)
return -EINVAL;
down(&policy->lock);
switch (policy->policy) { switch (policy->policy) {
case CPUFREQ_POLICY_POWERSAVE: case CPUFREQ_POLICY_POWERSAVE:
...@@ -644,6 +638,20 @@ int cpufreq_governor(unsigned int cpu, unsigned int event) ...@@ -644,6 +638,20 @@ int cpufreq_governor(unsigned int cpu, unsigned int event)
ret = -EINVAL; ret = -EINVAL;
} }
return ret;
}
int cpufreq_governor(unsigned int cpu, unsigned int event)
{
int ret = 0;
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
if (!policy)
return -EINVAL;
down(&policy->lock);
ret = __cpufreq_governor(policy, event);
up(&policy->lock); up(&policy->lock);
cpufreq_cpu_put(policy); cpufreq_cpu_put(policy);
......
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