diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-05-14 00:59:27 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-05-30 14:34:16 +0200 |
commit | d6ff44d647a9c63911983da9979961fde306b3aa (patch) | |
tree | 1816b50de3b3a99cafbef84a9cb0ad5c6599c049 /drivers | |
parent | Linux 4.7-rc1 (diff) | |
download | linux-d6ff44d647a9c63911983da9979961fde306b3aa.tar.xz linux-d6ff44d647a9c63911983da9979961fde306b3aa.zip |
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')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 9 |
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) cpufreq_update_current_freq(policy); ret = cpufreq_governor(policy, CPUFREQ_GOV_START); - return ret ? ret : cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); + if (ret) + return ret; + + cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); + return 0; } int cpufreq_register_governor(struct cpufreq_governor *governor) @@ -2195,7 +2199,8 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, if (new_policy->governor == policy->governor) { pr_debug("cpufreq: governor limits update\n"); - return cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); + cpufreq_governor(policy, CPUFREQ_GOV_LIMITS); + return 0; } pr_debug("governor switch\n"); |