Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 73d427cc authored by Viresh Kumar's avatar Viresh Kumar Committed by Andres Oportus
Browse files

UPSTREAM: cpufreq: governor: Create cpufreq_policy_apply_limits()



Create a new helper to avoid code duplication across governors.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit bf2be2de)
parent 48f5adc3
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -463,14 +463,7 @@ static void sugov_limits(struct cpufreq_policy *policy)

	if (!policy->fast_switch_enabled) {
		mutex_lock(&sg_policy->work_lock);

		if (policy->max < policy->cur)
			__cpufreq_driver_target(policy, policy->max,
						CPUFREQ_RELATION_H);
		else if (policy->min > policy->cur)
			__cpufreq_driver_target(policy, policy->min,
						CPUFREQ_RELATION_L);

		cpufreq_policy_apply_limits(policy);
		mutex_unlock(&sg_policy->work_lock);
	}