56d3e4f21eb75931ae477ecde83d275f7a5f880f
[openwrt/openwrt.git] / target / linux / mediatek / patches / 0014-thermal-Add-comment-explaining-test-for-critical-tem.patch
1 From 18f50eae474edc716b01959fad6898c8553b131c Mon Sep 17 00:00:00 2001
2 From: Sascha Hauer <s.hauer@pengutronix.de>
3 Date: Wed, 13 May 2015 10:52:33 +0200
4 Subject: [PATCH 14/76] thermal: Add comment explaining test for critical
5 temperature
6
7 The code testing if a temperature should be emulated or not is
8 not obvious. Add a comment explaining why this test is done.
9
10 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
11 Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
12 ---
13 drivers/thermal/thermal_core.c | 5 +++++
14 1 file changed, 5 insertions(+)
15
16 diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
17 index 3e0fe55..e204deb 100644
18 --- a/drivers/thermal/thermal_core.c
19 +++ b/drivers/thermal/thermal_core.c
20 @@ -435,6 +435,11 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
21 }
22 }
23
24 + /*
25 + * Only allow emulating a temperature when the real temperature
26 + * is below the critical temperature so that the emulation code
27 + * cannot hide critical conditions.
28 + */
29 if (!ret && *temp < crit_temp)
30 *temp = tz->emul_temperature;
31 }
32 --
33 1.7.10.4
34