Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 934c93b8 authored by Sascha Hauer's avatar Sascha Hauer Committed by Zhang Rui
Browse files

thermal: Add comment explaining test for critical temperature



The code testing if a temperature should be emulated or not is
not obvious. Add a comment explaining why this test is done.

Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: default avatarMikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 79e5421c
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -498,6 +498,11 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
			}
			}
		}
		}


		/*
		 * Only allow emulating a temperature when the real temperature
		 * is below the critical temperature so that the emulation code
		 * cannot hide critical conditions.
		 */
		if (!ret && *temp < crit_temp)
		if (!ret && *temp < crit_temp)
			*temp = tz->emul_temperature;
			*temp = tz->emul_temperature;
	}
	}