From: Daniel Lezcano Date: Wed, 1 Mar 2023 20:14:33 +0000 (+0100) Subject: thermal/core: Show a debug message when get_temp() fails X-Git-Tag: v6.6.7~3017^2~2^2^2~12^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4216e815321580b24dcb972a078ae3f0c808a464;p=platform%2Fkernel%2Flinux-starfive.git 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 Acked-by: Rafael J. Wysocki Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/thermal/thermal_helpers.c b/drivers/thermal/thermal_helpers.c index 0f64813..92e7e7f 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; }