struct cpufreq_policy new_policy;
int ret;
struct cpufreq_policy new_policy;
int ret;
- if (!policy) {
- ret = -ENODEV;
- goto no_policy;
- }
+ if (!policy)
+ return -ENODEV;
down_write(&policy->rwsem);
down_write(&policy->rwsem);
new_policy.cur = cpufreq_driver->get(cpu);
if (WARN_ON(!new_policy.cur)) {
ret = -EIO;
new_policy.cur = cpufreq_driver->get(cpu);
if (WARN_ON(!new_policy.cur)) {
ret = -EIO;
ret = cpufreq_set_policy(policy, &new_policy);
ret = cpufreq_set_policy(policy, &new_policy);
up_write(&policy->rwsem);
cpufreq_cpu_put(policy);
up_write(&policy->rwsem);
cpufreq_cpu_put(policy);
return ret;
}
EXPORT_SYMBOL(cpufreq_update_policy);
return ret;
}
EXPORT_SYMBOL(cpufreq_update_policy);