diff options
author | Peter De Schrijver <pdeschrijver@nvidia.com> | 2012-09-11 17:27:51 +0300 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2012-09-14 05:14:31 -0700 |
commit | 0292d082d531623b27ef4c85e7c1e5c9f564499d (patch) | |
tree | c8d41af93f918efac2bd584644e226e2ddf6dfbb /drivers/cpuquiet | |
parent | 404fa7098c94acd834afe26f8f8732c0b6f659c4 (diff) |
cpuquiet: balanced governor requires cpufreq
The balanced governor relies on cpufreq for some of its decisions. Fail
initialization if there are no cpufreq OPP tables available.
Change-Id: I5d64215d56f50d5df52c1433208b1eb40440c812
Signed-off-by: Peter De Schrijver <pdeschrijver@nvidia.com>
Reviewed-on: http://git-master/r/131437
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Peter Boonstoppel <pboonstoppel@nvidia.com>
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>
Diffstat (limited to 'drivers/cpuquiet')
-rw-r--r-- | drivers/cpuquiet/governors/balanced.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/cpuquiet/governors/balanced.c b/drivers/cpuquiet/governors/balanced.c index 86a012a5ace5..f187206ef1c4 100644 --- a/drivers/cpuquiet/governors/balanced.c +++ b/drivers/cpuquiet/governors/balanced.c @@ -511,8 +511,14 @@ static int balanced_start(void) down_delay = msecs_to_jiffies(2000); table = cpufreq_frequency_get_table(0); + if (!table) + return -EINVAL; + for (count = 0; table[count].frequency != CPUFREQ_TABLE_END; count++); + if (count < 4) + return -EINVAL; + idle_top_freq = table[(count / 2) - 1].frequency; idle_bottom_freq = table[(count / 2) - 2].frequency; |