On 12/18/2018 10:44 PM, Eduardo Valentin wrote: > On Mon, Dec 17, 2018 at 04:56:41PM +0100, marek.vasut@xxxxxxxxx wrote: >> From: Marek Vasut <marek.vasut@xxxxxxxxx> >> >> Register hwmon sysfs interface in thermal_zone_of_sensor_register_param() >> in case thermal_zone_params->no_hwmon is set to false. This behavior is >> the same as thermal_zone_device_register(). >> >> From: Marek Vasut <marek.vasut+renesas@xxxxxxxxx> >> Cc: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx> >> Cc: Eduardo Valentin <edubezval@xxxxxxxxx> >> Cc: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx> >> Cc: Zhang Rui <rui.zhang@xxxxxxxxx> >> Cc: linux-renesas-soc@xxxxxxxxxxxxxxx >> To: linux-pm@xxxxxxxxxxxxxxx >> Signed-off-by: Marek Vasut <marek.vasut+renesas@xxxxxxxxx> >> --- >> V2: No change >> V3: - Work around the From line and SoB line checkpatch warning >> - Reorder the SoB line at the end >> --- >> drivers/thermal/of-thermal.c | 12 +++++++++++- >> 1 file changed, 11 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c >> index e1a303a5698c..5ccff7b678de 100644 >> --- a/drivers/thermal/of-thermal.c >> +++ b/drivers/thermal/of-thermal.c >> @@ -15,6 +15,7 @@ >> #include <linux/string.h> >> >> #include "thermal_core.h" >> +#include "thermal_hwmon.h" >> >> /*** Private data structures to represent thermal device tree data ***/ >> >> @@ -521,8 +522,15 @@ thermal_zone_of_sensor_register_params(struct device *dev, int sensor_id, >> if (sensor_specs.np == sensor_np && id == sensor_id) { >> tzd = thermal_zone_of_add_sensor(child, sensor_np, >> data, ops); >> - if (!IS_ERR(tzd)) >> + if (!IS_ERR(tzd)) { >> + tzd->tzp = tzp; > > So, here you will overwrite what was done in of_parse_thermal_zones(). > That means, after this point, property like sustainable power, slope and > offset are gone. Hmmmmm, that was rather inobvious, indeed. Do you have some suggestion how to pass in the no_hwmon = false then ? Since tzp->no_hwmon is set to true in of_parse_thermal_zones(), the three drivers (stm32, rcar, rcar_gen3) seem to hack around it. I'd like to clean that up. -- Best regards, Marek Vasut