summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/hisi_thermal.c
diff options
context:
space:
mode:
authorEduardo Valentin <edubezval@gmail.com>2016-03-09 13:07:13 -0800
committerEduardo Valentin <edubezval@gmail.com>2016-05-17 07:28:26 -0700
commit44a520d81e70eac35833b0c2dc24d8daa371f557 (patch)
tree52b565032a2ab37e65ed4ccbae266d6822efc07f /drivers/thermal/hisi_thermal.c
parente28d0c9cd381e115c2270bf1d6fe4de95289234a (diff)
downloadop-kernel-dev-44a520d81e70eac35833b0c2dc24d8daa371f557.zip
op-kernel-dev-44a520d81e70eac35833b0c2dc24d8daa371f557.tar.gz
thermal: convert hisi_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-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Diffstat (limited to 'drivers/thermal/hisi_thermal.c')
-rw-r--r--drivers/thermal/hisi_thermal.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c
index 5e820b5..aee88bd 100644
--- a/drivers/thermal/hisi_thermal.c
+++ b/drivers/thermal/hisi_thermal.c
@@ -243,8 +243,8 @@ static int hisi_thermal_register_sensor(struct platform_device *pdev,
sensor->id = index;
sensor->thermal = data;
- sensor->tzd = thermal_zone_of_sensor_register(&pdev->dev, sensor->id,
- sensor, &hisi_of_thermal_ops);
+ sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev,
+ sensor->id, sensor, &hisi_of_thermal_ops);
if (IS_ERR(sensor->tzd)) {
ret = PTR_ERR(sensor->tzd);
dev_err(&pdev->dev, "failed to register sensor id %d: %d\n",
@@ -364,7 +364,6 @@ static int hisi_thermal_remove(struct platform_device *pdev)
struct hisi_thermal_sensor *sensor = &data->sensors[i];
hisi_thermal_toggle_sensor(sensor, false);
- thermal_zone_of_sensor_unregister(&pdev->dev, sensor->tzd);
}
hisi_thermal_disable_sensor(data);
OpenPOWER on IntegriCloud