OSDN Git Service

thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs()
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 1 Mar 2023 20:14:36 +0000 (21:14 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 3 Mar 2023 19:45:02 +0000 (20:45 +0100)
commit4a16c190f761cb3a87dcbbf355f91c71ce1f8c0b
treee43ca75ccef305b6c8bc2bbdd3eb65fe0b9890dc
parent8f3f4ad4ad45e2e30c814de42629ef4c9688e92c
thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs()

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
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> #sun8i_thermal
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> #MediaTek auxadc
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
14 files changed:
drivers/thermal/amlogic_thermal.c
drivers/thermal/imx8mm_thermal.c
drivers/thermal/imx_sc_thermal.c
drivers/thermal/k3_bandgap.c
drivers/thermal/mediatek/auxadc_thermal.c
drivers/thermal/qcom/qcom-spmi-adc-tm5.c
drivers/thermal/qcom/qcom-spmi-temp-alarm.c
drivers/thermal/qcom/tsens.c
drivers/thermal/qoriq_thermal.c
drivers/thermal/sun8i_thermal.c
drivers/thermal/tegra/tegra30-tsensor.c
drivers/thermal/thermal_hwmon.c
drivers/thermal/thermal_hwmon.h
drivers/thermal/ti-soc-thermal/ti-thermal-common.c