Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25907
b: refs/heads/master
c: 7970e08
h: refs/heads/master
i:
  25905: 408b28d
  25903: 9e688bf
v: v3
  • Loading branch information
Thomas Renninger authored and Dave Jones committed Apr 18, 2006
1 parent 33d6783 commit 505ebf1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 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: f1f76afd71e0f17af9a35fcb649f4bab53304a4d
refs/heads/master: 7970e08bf066900efcd7794a1a338c11eb8f5141
17 changes: 15 additions & 2 deletions trunk/drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ show_one(scaling_min_freq, min);
show_one(scaling_max_freq, max);
show_one(scaling_cur_freq, cur);

static int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy);

/**
* cpufreq_per_cpu_attr_write() / store_##file_name() - sysfs write access
*/
Expand All @@ -364,7 +366,10 @@ static ssize_t store_##file_name \
if (ret != 1) \
return -EINVAL; \
\
ret = cpufreq_set_policy(&new_policy); \
mutex_lock(&policy->lock); \
ret = __cpufreq_set_policy(policy, &new_policy); \
policy->user_policy.object = policy->object; \
mutex_unlock(&policy->lock); \
\
return ret ? ret : count; \
}
Expand Down Expand Up @@ -420,7 +425,15 @@ static ssize_t store_scaling_governor (struct cpufreq_policy * policy,
if (cpufreq_parse_governor(str_governor, &new_policy.policy, &new_policy.governor))
return -EINVAL;

ret = cpufreq_set_policy(&new_policy);
/* Do not use cpufreq_set_policy here or the user_policy.max
will be wrongly overridden */
mutex_lock(&policy->lock);
ret = __cpufreq_set_policy(policy, &new_policy);

policy->user_policy.policy = policy->policy;
policy->user_policy.governor = policy->governor;
mutex_unlock(&policy->lock);

return ret ? ret : count;
}

Expand Down

0 comments on commit 505ebf1

Please sign in to comment.