OSDN Git Service

thermal: Introduce devm_thermal_of_cooling_device_register
authorGuenter Roeck <linux@roeck-us.net>
Thu, 18 Apr 2019 19:58:15 +0000 (12:58 -0700)
committerEduardo Valentin <edubezval@gmail.com>
Tue, 14 May 2019 14:00:30 +0000 (07:00 -0700)
commitb4ab114cc6a1bbf8ca1d9a2339f2b5b43374029b
treee17da3fac76dfcc4b2216acb05ffb986876801b4
parent80d95930dcdf06315cfde408c18783c811bf3db9
thermal: Introduce devm_thermal_of_cooling_device_register

thermal_of_cooling_device_register() and thermal_cooling_device_register()
are typically called from driver probe functions, and
thermal_cooling_device_unregister() is called from remove functions. This
makes both a perfect candidate for device managed functions.

Introduce devm_thermal_of_cooling_device_register(). This function can
also be used to replace thermal_cooling_device_register() by passing a NULL
pointer as device node. The new function requires both struct device *
and struct device_node * as parameters since the struct device_node *
parameter is not always identical to dev->of_node.

Don't introduce a device managed remove function since it is not needed
at this point.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/thermal_core.c
include/linux/thermal.h