diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-07-06 09:46:17 +0200 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2015-08-03 23:15:51 +0800 |
commit | 934c93b8c193b62fc86256ea64aef65e9a7b4e9e (patch) | |
tree | 647eadf253c36d1f400af46b8cbbce9a1fe8f82e /drivers/thermal/thermal_core.c | |
parent | 79e5421cf0bd9b3e56f523e95e3511757edb9616 (diff) | |
download | linux-934c93b8c193b62fc86256ea64aef65e9a7b4e9e.tar.gz linux-934c93b8c193b62fc86256ea64aef65e9a7b4e9e.tar.bz2 linux-934c93b8c193b62fc86256ea64aef65e9a7b4e9e.zip |
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: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/thermal_core.c')
-rw-r--r-- | drivers/thermal/thermal_core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 9599465abeac..6a707789746b 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -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) *temp = tz->emul_temperature; } |