mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
cpufreq: allow driver-specific data
This commit extends the cpufreq_driver structure with an additional 'void *driver_data' field that can be filled by the ->probe() function of a cpufreq driver to pass additional custom information to the driver itself. A new function called cpufreq_get_driver_data() is added to allow a cpufreq driver to retrieve those driver data, since they are typically needed from a cpufreq_policy->init() callback, which does not have access to the cpufreq_driver structure. This function call is similar to the existing cpufreq_get_current_driver() function call. Signed-off-by: Thomas Petazzoni <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
f114040e3e
commit
51315cdfa0
2 changed files with 17 additions and 0 deletions
|
|
@ -1731,6 +1731,21 @@ const char *cpufreq_get_current_driver(void)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(cpufreq_get_current_driver);
|
||||
|
||||
/**
|
||||
* cpufreq_get_driver_data - return current driver data
|
||||
*
|
||||
* Return the private data of the currently loaded cpufreq
|
||||
* driver, or NULL if no cpufreq driver is loaded.
|
||||
*/
|
||||
void *cpufreq_get_driver_data(void)
|
||||
{
|
||||
if (cpufreq_driver)
|
||||
return cpufreq_driver->driver_data;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cpufreq_get_driver_data);
|
||||
|
||||
/*********************************************************************
|
||||
* NOTIFIER LISTS INTERFACE *
|
||||
*********************************************************************/
|
||||
|
|
|
|||
Loading…
Reference in a new issue