summaryrefslogtreecommitdiff
path: root/drivers/thermal/devfreq_cooling.c
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-11-02 19:03:03 +0000
committerEduardo Valentin <edubezval@gmail.com>2015-11-02 13:14:44 -0800
commit3c99c2cef75eb5bfc05c5728e4560f3ee656d47e (patch)
tree9fe73987c16ee8d1eae257e3f569a78b21d9b1c7 /drivers/thermal/devfreq_cooling.c
parent8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943 (diff)
thermal: devfreq_cooling: use a thermal_cooling_device for register and unregister
Be consistent with what other cooling devices do and return a struct thermal_cooling_device * on register. Also, for the unregister, accept a struct thermal_cooling_device * as parameter. Cc: Zhang Rui <rui.zhang@intel.com> Cc: Eduardo Valentin <edubezval@gmail.com> Signed-off-by: Javi Merino <javi.merino@arm.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal/devfreq_cooling.c')
-rw-r--r--drivers/thermal/devfreq_cooling.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/thermal/devfreq_cooling.c b/drivers/thermal/devfreq_cooling.c
index a27206815066..31e40a9a9fd0 100644
--- a/drivers/thermal/devfreq_cooling.c
+++ b/drivers/thermal/devfreq_cooling.c
@@ -467,7 +467,7 @@ free_power_table:
* devfreq should use the simple_ondemand governor, other governors
* are not currently supported.
*/
-struct devfreq_cooling_device *
+struct thermal_cooling_device *
of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
struct devfreq_cooling_power *dfc_power)
{
@@ -513,7 +513,7 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
dfc->cdev = cdev;
- return dfc;
+ return cdev;
release_idr:
release_idr(&devfreq_idr, dfc->id);
@@ -533,7 +533,7 @@ EXPORT_SYMBOL_GPL(of_devfreq_cooling_register_power);
* @np: Pointer to OF device_node.
* @df: Pointer to devfreq device.
*/
-struct devfreq_cooling_device *
+struct thermal_cooling_device *
of_devfreq_cooling_register(struct device_node *np, struct devfreq *df)
{
return of_devfreq_cooling_register_power(np, df, NULL);
@@ -544,7 +544,7 @@ EXPORT_SYMBOL_GPL(of_devfreq_cooling_register);
* devfreq_cooling_register() - Register devfreq cooling device.
* @df: Pointer to devfreq device.
*/
-struct devfreq_cooling_device *devfreq_cooling_register(struct devfreq *df)
+struct thermal_cooling_device *devfreq_cooling_register(struct devfreq *df)
{
return of_devfreq_cooling_register(NULL, df);
}
@@ -554,11 +554,15 @@ EXPORT_SYMBOL_GPL(devfreq_cooling_register);
* devfreq_cooling_unregister() - Unregister devfreq cooling device.
* @dfc: Pointer to devfreq cooling device to unregister.
*/
-void devfreq_cooling_unregister(struct devfreq_cooling_device *dfc)
+void devfreq_cooling_unregister(struct thermal_cooling_device *cdev)
{
- if (!dfc)
+ struct devfreq_cooling_device *dfc;
+
+ if (!cdev)
return;
+ dfc = cdev->devdata;
+
thermal_cooling_device_unregister(dfc->cdev);
release_idr(&devfreq_idr, dfc->id);
kfree(dfc->power_table);