Skip to content

Commit 7e497a7

Browse files
jwrdegoedeEduardo Valentin
authored andcommitted
thermal: Do not log an error if thermal_zone_get_temp returns -EAGAIN
Some temperature sensors only get updated every few seconds and while waiting for the first irq reporting a (new) temperature to happen there get_temp operand will return -EAGAIN as it does not have any data to report yet. Not logging an error in this case avoids messages like these from showing up in dmesg on affected systems: [ 1.219353] thermal thermal_zone0: failed to read out thermal zone 0 [ 2.015433] thermal thermal_zone0: failed to read out thermal zone 0 [ 2.416737] thermal thermal_zone0: failed to read out thermal zone 0 Reviewed-by: Dmitry Torokhov <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Eduardo Valentin <[email protected]>
1 parent 2771d00 commit 7e497a7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/thermal/thermal_core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,10 @@ static void update_temperature(struct thermal_zone_device *tz)
458458

459459
ret = thermal_zone_get_temp(tz, &temp);
460460
if (ret) {
461-
dev_warn(&tz->device, "failed to read out thermal zone %d\n",
462-
tz->id);
461+
if (ret != -EAGAIN)
462+
dev_warn(&tz->device,
463+
"failed to read out thermal zone (%d)\n",
464+
ret);
463465
return;
464466
}
465467

0 commit comments

Comments
 (0)