Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110793
b: refs/heads/master
c: f1829e4
h: refs/heads/master
i:
  110791: 4dc0c11
v: v3
  • Loading branch information
Julia Lawall authored and Dave Jones committed Oct 9, 2008
1 parent 9ab7b80 commit 44d08e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 888a794cacd8950ac6be701db20b62a4ab2ce90c
refs/heads/master: f1829e4a371f26430185a9d5b97b8d9d19824e08
24 changes: 16 additions & 8 deletions trunk/drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,20 +1467,22 @@ int cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned int target_freq,
unsigned int relation)
{
int ret;
int ret = -EINVAL;

policy = cpufreq_cpu_get(policy->cpu);
if (!policy)
return -EINVAL;
goto no_policy;

if (unlikely(lock_policy_rwsem_write(policy->cpu)))
return -EINVAL;
goto fail;

ret = __cpufreq_driver_target(policy, target_freq, relation);

unlock_policy_rwsem_write(policy->cpu);

fail:
cpufreq_cpu_put(policy);
no_policy:
return ret;
}
EXPORT_SYMBOL_GPL(cpufreq_driver_target);
Expand Down Expand Up @@ -1717,13 +1719,17 @@ int cpufreq_update_policy(unsigned int cpu)
{
struct cpufreq_policy *data = cpufreq_cpu_get(cpu);
struct cpufreq_policy policy;
int ret = 0;
int ret;

if (!data)
return -ENODEV;
if (!data) {
ret = -ENODEV;
goto no_policy;
}

if (unlikely(lock_policy_rwsem_write(cpu)))
return -EINVAL;
if (unlikely(lock_policy_rwsem_write(cpu))) {
ret = -EINVAL;
goto fail;
}

dprintk("updating policy for CPU %u\n", cpu);
memcpy(&policy, data, sizeof(struct cpufreq_policy));
Expand All @@ -1750,7 +1756,9 @@ int cpufreq_update_policy(unsigned int cpu)

unlock_policy_rwsem_write(cpu);

fail:
cpufreq_cpu_put(data);
no_policy:
return ret;
}
EXPORT_SYMBOL(cpufreq_update_policy);
Expand Down

0 comments on commit 44d08e4

Please sign in to comment.