Re: [PATCH v2 05/16] thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs()

Jernej Škrabec
2023-02-21T18:23:21Z

Dne torek, 21. februar 2023 ob 19:06:59 CET je Daniel Lezcano napisal(a):
> The devres variant of thermal_add_hwmon_sysfs() only takes the thermal
> zone structure pointer as parameter.
>
> Actually, it uses the tz->device to add it in the devres list.
>
> It is preferable to use the device registering the thermal zone
> instead of the thermal zone device itself. That prevents the driver
> accessing the thermal zone structure internals and it is from my POV
> more correct regarding how devm_ is used.
>
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> #amlogic_thermal ---
> drivers/thermal/amlogic_thermal.c | 2 +-
> drivers/thermal/imx8mm_thermal.c | 2 +-
> drivers/thermal/imx_sc_thermal.c | 2 +-
> drivers/thermal/k3_bandgap.c | 2 +-
> drivers/thermal/mediatek/auxadc_thermal.c | 2 +-
> drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 2 +-
> drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 2 +-
> drivers/thermal/qcom/tsens.c | 2 +-
> drivers/thermal/qoriq_thermal.c | 2 +-
> drivers/thermal/sun8i_thermal.c | 2 +-

For sun8i_thermal:
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej

> drivers/thermal/tegra/tegra30-tsensor.c | 2 +-
> drivers/thermal/thermal_hwmon.c | 4 ++--
> drivers/thermal/thermal_hwmon.h | 4 ++--
> drivers/thermal/ti-soc-thermal/ti-thermal-common.c | 2 +-
> 14 files changed, 16 insertions(+), 16 deletions(-)