[4/4] cpufreq: Pass updated policy to driver ->setpolicy() callback
diff mbox series

Message ID 1982548.ex0OEcQ4PI@aspire.rjw.lan
State Accepted
Commit 167a38dcd5caaa85994ac8b7d2d1c20a71cd947b
Headers show
Series
  • cpufreq: Assorted cleanups related to cpufreq_set_policy()
Related show

Commit Message

Rafael J. Wysocki Feb. 19, 2019, 11:26 p.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

The invocation of the ->setpolicy() cpufreq driver callback should
be equivalent to calling cpufreq_governor_limits(policy) for drivers
with internal governors, but in fact it isn't so, because the
temporary new_policy object is passed to it instead of the updated
policy.

That is a bit confusing, so make cpufreq_set_policy() pass the
updated policy to the driver ->setpolicy() callback.

No intentional changes of behavior.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/cpufreq/cpufreq.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

Index: linux-pm/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-pm.orig/drivers/cpufreq/cpufreq.c
+++ linux-pm/drivers/cpufreq/cpufreq.c
@@ -2286,7 +2286,7 @@  static int cpufreq_set_policy(struct cpu
 	if (cpufreq_driver->setpolicy) {
 		policy->policy = new_policy->policy;
 		pr_debug("setting range\n");
-		return cpufreq_driver->setpolicy(new_policy);
+		return cpufreq_driver->setpolicy(policy);
 	}
 
 	if (new_policy->governor == policy->governor) {