summaryrefslogtreecommitdiff
path: root/drivers/thermal/thermal_helpers.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2023-03-01 23:14:33 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-03-03 22:45:02 +0300
commit4216e815321580b24dcb972a078ae3f0c808a464 (patch)
tree356550bb6641180bf437794ca973ef86c40d4958 /drivers/thermal/thermal_helpers.c
parent3d4e1bad7804bee102bb1e992f2831e4c6658f88 (diff)
downloadlinux-4216e815321580b24dcb972a078ae3f0c808a464.tar.xz
thermal/core: Show a debug message when get_temp() fails
The different thermal drivers are showing an error in case the get_temp() fails. Actually no traces should be displayed in the backend ops but in the call site of this ops. Furthermore, the message is often a dev_dbg message where the tz->device is used, thus using the internal of the structure from the driver. Show a debug message if the thermal_zone_get_temp() fails to read the sensor temperature, so code showing the message is factored out and the tz->device accesss is in the scope of the thermal core framework. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_helpers.c')
-rw-r--r--drivers/thermal/thermal_helpers.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c
index 0f648131b0b5..92e7e7fd7357 100644
--- a/drivers/thermal/thermal_helpers.c
+++ b/drivers/thermal/thermal_helpers.c
@@ -107,6 +107,9 @@ int __thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
*temp = tz->emul_temperature;
}
+ if (ret)
+ dev_dbg(&tz->device, "Failed to get temperature: %d\n", ret);
+
return ret;
}