mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 00:04:15 +08:00
cpufreq: Add a get_current_driver helper
Add a helper function to return cpufreq_driver->name. Signed-off-by: Borislav Petkov <bp@suse.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
741220ea86
commit
9d95046e5d
@ -1395,6 +1395,20 @@ static struct syscore_ops cpufreq_syscore_ops = {
|
||||
.resume = cpufreq_bp_resume,
|
||||
};
|
||||
|
||||
/**
|
||||
* cpufreq_get_current_driver - return current driver's name
|
||||
*
|
||||
* Return the name string of the currently loaded cpufreq driver
|
||||
* or NULL, if none.
|
||||
*/
|
||||
const char *cpufreq_get_current_driver(void)
|
||||
{
|
||||
if (cpufreq_driver)
|
||||
return cpufreq_driver->name;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cpufreq_get_current_driver);
|
||||
|
||||
/*********************************************************************
|
||||
* NOTIFIER LISTS INTERFACE *
|
||||
|
@ -411,4 +411,5 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
|
||||
void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
|
||||
|
||||
void cpufreq_frequency_table_put_attr(unsigned int cpu);
|
||||
const char *cpufreq_get_current_driver(void);
|
||||
#endif /* _LINUX_CPUFREQ_H */
|
||||
|
Loading…
Reference in New Issue
Block a user