diff mbox series

thermal: core: don't warn in case of ENODATA

Message ID 160717f1-4bf1-842a-8c11-9c4d03962d0b@gmail.com
State New
Headers show
Series thermal: core: don't warn in case of ENODATA | expand

Commit Message

Heiner Kallweit Nov. 23, 2020, 3:03 p.m. UTC
Some devices provide temperature data only in a specific state,
e.g. iwlwifi requires that network device is up (firmware running).
If a device knowingly provides no data, then there's no point in
alerting the user. However the info about the missing data might be
useful in some cases, therefore add a debug message.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/thermal/thermal_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 90e38cc19..19bb6c99c 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -454,7 +454,9 @@  static void update_temperature(struct thermal_zone_device *tz)
 
 	ret = thermal_zone_get_temp(tz, &temp);
 	if (ret) {
-		if (ret != -EAGAIN)
+		if (ret == -ENODATA)
+			dev_dbg(&tz->device, "no temperature data available\n");
+		else if (ret != -EAGAIN)
 			dev_warn(&tz->device,
 				 "failed to read out thermal zone (%d)\n",
 				 ret);