aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-13 18:59:27 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-05-30 08:34:16 -0400
commitd6ff44d647a9c63911983da9979961fde306b3aa (patch)
tree1816b50de3b3a99cafbef84a9cb0ad5c6599c049 /drivers/cpufreq/cpufreq.c
parent1a695a905c18548062509178b98bc91e67510864 (diff)
cpufreq: governor: CPUFREQ_GOV_LIMITS never fails
None of the cpufreq governors currently in the tree will ever fail an invocation of the ->governor() callback with the event argument equal to CPUFREQ_GOV_LIMITS (unless invoked with incorrect arguments which doesn't matter anyway) and had it ever failed, the result of it wouldn't have been very clean. For this reason, rearrange the code in the core to ignore the return value of cpufreq_governor() when called with event equal to CPUFREQ_GOV_LIMITS. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 36bc11a106aa..e3e666109e21 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2054,7 +2054,11 @@ static int cpufreq_start_governor(struct cpufreq_policy *policy)
2054 cpufreq_update_current_freq(policy); 2054 cpufreq_update_current_freq(policy);
2055 2055
2056 ret = cpufreq_governor(policy, CPUFREQ_GOV_START); 2056 ret = cpufreq_governor(policy, CPUFREQ_GOV_START);
2057 return ret ? ret : cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); 2057 if (ret)
2058 return ret;
2059
2060 cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
2061 return 0;
2058} 2062}
2059 2063
2060int cpufreq_register_governor(struct cpufreq_governor *governor) 2064int cpufreq_register_governor(struct cpufreq_governor *governor)
@@ -2195,7 +2199,8 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
2195 2199
2196 if (new_policy->governor == policy->governor) { 2200 if (new_policy->governor == policy->governor) {
2197 pr_debug("cpufreq: governor limits update\n"); 2201 pr_debug("cpufreq: governor limits update\n");
2198 return cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); 2202 cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
2203 return 0;
2199 } 2204 }
2200 2205
2201 pr_debug("governor switch\n"); 2206 pr_debug("governor switch\n");