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>
}
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);