diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2020-10-23 17:35:46 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2020-10-29 14:07:30 +0100 |
commit | a62f68f5ca53ab61cba2f0a410d0add7a6d54a52 (patch) | |
tree | 5e88c9c645162205c9ad9f1e6d7909141178f3fe /drivers/cpufreq/cpufreq.c | |
parent | 00d4394792418f8fe968f0cb22557053c6310010 (diff) | |
download | lwn-a62f68f5ca53ab61cba2f0a410d0add7a6d54a52.tar.gz lwn-a62f68f5ca53ab61cba2f0a410d0add7a6d54a52.zip |
cpufreq: Introduce cpufreq_driver_test_flags()
Add a helper function to test the flags of the cpufreq driver in use
againt a given flags mask.
In particular, this will be needed to test the
CPUFREQ_NEED_UPDATE_LIMITS cpufreq driver flag in the schedutil
governor.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index ea58337fb65f..336b5e94cbc8 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -1908,6 +1908,18 @@ void cpufreq_resume(void) } /** + * cpufreq_driver_test_flags - Test cpufreq driver's flags against given ones. + * @flags: Flags to test against the current cpufreq driver's flags. + * + * Assumes that the driver is there, so callers must ensure that this is the + * case. + */ +bool cpufreq_driver_test_flags(u16 flags) +{ + return !!(cpufreq_driver->flags & flags); +} + +/** * cpufreq_get_current_driver - return current driver's name * * Return the name string of the currently loaded cpufreq driver |