summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/sun8i_thermal.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2023-03-01 21:14:36 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-03-03 20:45:02 +0100
commit4a16c190f761cb3a87dcbbf355f91c71ce1f8c0b (patch)
treee43ca75ccef305b6c8bc2bbdd3eb65fe0b9890dc /drivers/thermal/sun8i_thermal.c
parent8f3f4ad4ad45e2e30c814de42629ef4c9688e92c (diff)
downloadlinux-stable-4a16c190f761cb3a87dcbbf355f91c71ce1f8c0b.tar.gz
linux-stable-4a16c190f761cb3a87dcbbf355f91c71ce1f8c0b.tar.bz2
linux-stable-4a16c190f761cb3a87dcbbf355f91c71ce1f8c0b.zip
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>
Diffstat (limited to 'drivers/thermal/sun8i_thermal.c')
-rw-r--r--drivers/thermal/sun8i_thermal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c
index 6b550f0f90bf..793ddce72132 100644
--- a/drivers/thermal/sun8i_thermal.c
+++ b/drivers/thermal/sun8i_thermal.c
@@ -475,7 +475,7 @@ static int sun8i_ths_register(struct ths_device *tmdev)
if (IS_ERR(tmdev->sensor[i].tzd))
return PTR_ERR(tmdev->sensor[i].tzd);
- if (devm_thermal_add_hwmon_sysfs(tmdev->sensor[i].tzd))
+ if (devm_thermal_add_hwmon_sysfs(tmdev->dev, tmdev->sensor[i].tzd))
dev_warn(tmdev->dev,
"Failed to add hwmon sysfs attributes\n");
}