summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIrina Tirdea <irina.tirdea@nxp.com>2017-02-28 17:51:05 +0200
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit0f2887412a3593db71a612c48c3850e4917555a7 (patch)
treec514a11d8d3a9e964564859f5f9996459501b337
parent3747e0d59828e213d7d4c758fcc4ee20233809f0 (diff)
MLK-14291 thermal: imx: fix setting passive trip temp
When setting passive temperature trip point, it is not allowed to set a higher value than the default. Currently the driver compares the new temperature to set with a constant (0). This comparison wil always be true (temp to set higher than 0) and the driver will return -EINVAL. This is a leftover from rebasing the commit fc4fcd689419 ("MLK-11705 thermal: imx: make the critical trip temp changable for test"). Fix the comparison by using the actual default passive temperature value instead of the wrong constant. Signed-off-by: Irina Tirdea <irina.tirdea@nxp.com>
-rw-r--r--drivers/thermal/imx_thermal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 8ad444917a04..569a5e05f48c 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -461,7 +461,7 @@ static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip,
}
if (trip == IMX_TRIP_PASSIVE) {
- if (temp > IMX_TRIP_PASSIVE)
+ if (temp > (data->temp_max - (1000 * 10)))
return -EINVAL;
data->temp_passive = temp;
imx_set_alarm_temp(data, temp);