regulator: tps65910: Work around silicon erratum SWCZ010
[firefly-linux-kernel-4.4.55.git] / drivers / thermal / rockchip_thermal.c
index e845841ab036cc82033d0a6829058a0f15f2543e..7106288efae39910bda3953e12f10e8a2a1eace1 100644 (file)
@@ -545,15 +545,14 @@ static int rockchip_configure_from_dt(struct device *dev,
                         thermal->chip->tshut_temp);
                thermal->tshut_temp = thermal->chip->tshut_temp;
        } else {
+               if (shut_temp > INT_MAX) {
+                       dev_err(dev, "Invalid tshut temperature specified: %d\n",
+                               shut_temp);
+                       return -ERANGE;
+               }
                thermal->tshut_temp = shut_temp;
        }
 
-       if (thermal->tshut_temp > INT_MAX) {
-               dev_err(dev, "Invalid tshut temperature specified: %d\n",
-                       thermal->tshut_temp);
-               return -ERANGE;
-       }
-
        if (of_property_read_u32(np, "rockchip,hw-tshut-mode", &tshut_mode)) {
                dev_warn(dev,
                         "Missing tshut mode property, using default (%s)\n",