diff options
author | Eduardo Valentin <edubezval@gmail.com> | 2016-03-09 16:07:13 -0500 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2016-05-17 10:28:26 -0400 |
commit | 44a520d81e70eac35833b0c2dc24d8daa371f557 (patch) | |
tree | 52b565032a2ab37e65ed4ccbae266d6822efc07f | |
parent | e28d0c9cd381e115c2270bf1d6fe4de95289234a (diff) |
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>
-rw-r--r-- | drivers/thermal/hisi_thermal.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/thermal/hisi_thermal.c b/drivers/thermal/hisi_thermal.c index 5e820b541506..aee88bd3a5b6 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, | |||
243 | sensor->id = index; | 243 | sensor->id = index; |
244 | sensor->thermal = data; | 244 | sensor->thermal = data; |
245 | 245 | ||
246 | sensor->tzd = thermal_zone_of_sensor_register(&pdev->dev, sensor->id, | 246 | sensor->tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, |
247 | sensor, &hisi_of_thermal_ops); | 247 | sensor->id, sensor, &hisi_of_thermal_ops); |
248 | if (IS_ERR(sensor->tzd)) { | 248 | if (IS_ERR(sensor->tzd)) { |
249 | ret = PTR_ERR(sensor->tzd); | 249 | ret = PTR_ERR(sensor->tzd); |
250 | dev_err(&pdev->dev, "failed to register sensor id %d: %d\n", | 250 | 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) | |||
364 | struct hisi_thermal_sensor *sensor = &data->sensors[i]; | 364 | struct hisi_thermal_sensor *sensor = &data->sensors[i]; |
365 | 365 | ||
366 | hisi_thermal_toggle_sensor(sensor, false); | 366 | hisi_thermal_toggle_sensor(sensor, false); |
367 | thermal_zone_of_sensor_unregister(&pdev->dev, sensor->tzd); | ||
368 | } | 367 | } |
369 | 368 | ||
370 | hisi_thermal_disable_sensor(data); | 369 | hisi_thermal_disable_sensor(data); |