diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-12-03 23:11:57 -0500 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2014-12-08 11:08:57 -0500 |
commit | c9ca319f0579cd51b07a666683157233c2cf720d (patch) | |
tree | 1740504a07be64925982fdf3c9c3413eaf129a4f | |
parent | e1fae554fb69b8869acbea9397d15758a93d1204 (diff) |
thermal: cpu_cooling: Don't check is_cpufreq_valid()
Because get_cpu_frequency() has returned a valid frequency, it means that the
cpufreq policy is surely valid and so no point checking that again with
is_cpufreq_valid(). Get rid of the routine as well as there are no more users.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r-- | drivers/thermal/cpu_cooling.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index 7f27f1b44776..1dd4cc403a2a 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c | |||
@@ -110,23 +110,6 @@ static void release_idr(struct idr *idr, int id) | |||
110 | 110 | ||
111 | /* Below code defines functions to be used for cpufreq as cooling device */ | 111 | /* Below code defines functions to be used for cpufreq as cooling device */ |
112 | 112 | ||
113 | /** | ||
114 | * is_cpufreq_valid - function to check frequency transitioning capability. | ||
115 | * @cpu: cpu for which check is needed. | ||
116 | * | ||
117 | * This function will check the current state of the system if | ||
118 | * it is capable of changing the frequency for a given @cpu. | ||
119 | * | ||
120 | * Return: 0 if the system is not currently capable of changing | ||
121 | * the frequency of given cpu. !0 in case the frequency is changeable. | ||
122 | */ | ||
123 | static int is_cpufreq_valid(int cpu) | ||
124 | { | ||
125 | struct cpufreq_policy policy; | ||
126 | |||
127 | return !cpufreq_get_policy(&policy, cpu); | ||
128 | } | ||
129 | |||
130 | enum cpufreq_cooling_property { | 113 | enum cpufreq_cooling_property { |
131 | GET_LEVEL, | 114 | GET_LEVEL, |
132 | GET_FREQ, | 115 | GET_FREQ, |
@@ -300,8 +283,7 @@ static int cpufreq_apply_cooling(struct cpufreq_cooling_device *cpufreq_device, | |||
300 | cpufreq_device->cpufreq_state = cooling_state; | 283 | cpufreq_device->cpufreq_state = cooling_state; |
301 | cpufreq_device->cpufreq_val = clip_freq; | 284 | cpufreq_device->cpufreq_val = clip_freq; |
302 | 285 | ||
303 | if (is_cpufreq_valid(cpu)) | 286 | cpufreq_update_policy(cpu); |
304 | cpufreq_update_policy(cpu); | ||
305 | 287 | ||
306 | return 0; | 288 | return 0; |
307 | } | 289 | } |