* [PATCH] thermal: core: don't warn in case of ENODATA
@ 2020-11-23 15:03 Heiner Kallweit
0 siblings, 0 replies; only message in thread
From: Heiner Kallweit @ 2020-11-23 15:03 UTC (permalink / raw)
To: Zhang Rui, Daniel Lezcano, Amit Kucheria; +Cc: Linux PM
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 --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);
--
2.29.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-11-23 15:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-23 15:03 [PATCH] thermal: core: don't warn in case of ENODATA Heiner Kallweit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).