aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-07-06 09:46:17 +0200
committerZhang Rui <rui.zhang@intel.com>2015-08-03 23:15:51 +0800
commit934c93b8c193b62fc86256ea64aef65e9a7b4e9e (patch)
tree647eadf253c36d1f400af46b8cbbce9a1fe8f82e /drivers/thermal
parentthermal: Use IS_ENABLED instead of #ifdef (diff)
downloadlinux-dev-934c93b8c193b62fc86256ea64aef65e9a7b4e9e.tar.xz
linux-dev-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')
-rw-r--r--drivers/thermal/thermal_core.c5
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;
}