Re: [PATCH 57/62] thermal: rcar: enable to use thermal-zone on DT


Ben Hutchings <ben.hutchings@...>
 

On Thu, 2018-05-10 at 16:08 +0100, Biju Das wrote:
From: Kuninori Morimoto <kuninori.morimoto.gx@...>

This patch enables to use thermal-zone on DT if it was calles as
"renesas,rcar-thermal-gen2".
Previous style (= non thermal-zone) is still supported by
"renesas,rcar-thermal" to keep compatibility for "git bisect".

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@...>
Signed-off-by: Eduardo Valentin <edubezval@...>
(cherry picked from commit 8b477ea56383dc8b838f1f8b506e4571c14ceb30)
Signed-off-by: Biju Das <biju.das@...>
Reviewed-by: Fabrizio Castro <fabrizio.castro@...>
[...]
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
[...]
@@ -463,7 +492,13 @@ static int rcar_thermal_probe(struct platform_device *pdev)
  if (ret < 0)
  goto error_unregister;
 
- priv->zone = thermal_zone_device_register("rcar_thermal",
+ if (of_data == USE_OF_THERMAL)
+ priv->zone = thermal_zone_of_sensor_register(
+ dev, i, priv,
+ &rcar_thermal_zone_of_ops);
Doesn't this require a corresponding change to use
thermal_zone_of_sensor_unregister()?

It looks like this was fixed upstream by commits 5e325868aa59
("thermal: convert rcar_thermal to use
devm_thermal_zone_of_sensor_register") and d4b23c5c434a ("thermal:
rcar_thermal: don't call thermal_zone_device_unregister when
USE_OF_THERMAL").

Ben.

+ else
+ priv->zone = thermal_zone_device_register(
+ "rcar_thermal",
  1, 0, priv,
  &rcar_thermal_zone_ops, NULL, 0,
  idle);
--
Ben Hutchings
Software Developer, Codethink Ltd.

Join cip-dev@lists.cip-project.org to automatically receive all group messages.