thermal: convert ti-thermal to use devm_thermal_zone_of_sensor_register
This changes the driver to use the devm_ version of thermal_zone_of_sensor_register and cleans up the local points and unregister calls. Cc: Zhang Rui <rui.zhang@intel.com> Cc: linux-pm@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: linux-kernel@vger.kernel.org Tested-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:
parent
71ca46eeef
commit
3982204cc9
|
@ -337,7 +337,7 @@ int ti_thermal_expose_sensor(struct ti_bandgap *bgp, int id,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* in case this is specified by DT */
|
/* in case this is specified by DT */
|
||||||
data->ti_thermal = thermal_zone_of_sensor_register(bgp->dev, id,
|
data->ti_thermal = devm_thermal_zone_of_sensor_register(bgp->dev, id,
|
||||||
data, &ti_of_thermal_ops);
|
data, &ti_of_thermal_ops);
|
||||||
if (IS_ERR(data->ti_thermal)) {
|
if (IS_ERR(data->ti_thermal)) {
|
||||||
/* Create thermal zone */
|
/* Create thermal zone */
|
||||||
|
@ -368,9 +368,6 @@ int ti_thermal_remove_sensor(struct ti_bandgap *bgp, int id)
|
||||||
if (data && data->ti_thermal) {
|
if (data && data->ti_thermal) {
|
||||||
if (data->our_zone)
|
if (data->our_zone)
|
||||||
thermal_zone_device_unregister(data->ti_thermal);
|
thermal_zone_device_unregister(data->ti_thermal);
|
||||||
else
|
|
||||||
thermal_zone_of_sensor_unregister(bgp->dev,
|
|
||||||
data->ti_thermal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue