diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2019-06-25 07:32:41 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-06-26 04:59:57 -0400 |
commit | bcc61569997b2188ba89db43b5b991da01ea2d18 (patch) | |
tree | 8534cfc8864efe3f43247b2234c87e5a26677381 /include/linux/cpufreq.h | |
parent | fba7402017f95c75281991c58d25f1836c04d9bd (diff) |
cpufreq: Move the IS_ENABLED(CPU_THERMAL) macro into a stub
cpufreq_online() and cpufreq_offline() [un]register the driver as
a cooling device. This is done if the driver is flagged as a cooling
device in addition with an IS_ENABLED() check to compile out the branching
code.
Group this test in a stub function added in the cpufreq header instead
of having the IS_ENABLED() in the code.
Suggested-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r-- | include/linux/cpufreq.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index d01a74fbc4db..a1467aa7f58b 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -409,6 +409,12 @@ int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); | |||
409 | const char *cpufreq_get_current_driver(void); | 409 | const char *cpufreq_get_current_driver(void); |
410 | void *cpufreq_get_driver_data(void); | 410 | void *cpufreq_get_driver_data(void); |
411 | 411 | ||
412 | static inline int cpufreq_thermal_control_enabled(struct cpufreq_driver *drv) | ||
413 | { | ||
414 | return IS_ENABLED(CONFIG_CPU_THERMAL) && | ||
415 | (drv->flags & CPUFREQ_IS_COOLING_DEV); | ||
416 | } | ||
417 | |||
412 | static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, | 418 | static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, |
413 | unsigned int min, unsigned int max) | 419 | unsigned int min, unsigned int max) |
414 | { | 420 | { |