Merge tag 'block-5.14-2021-08-13' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / drivers / thermal / rcar_gen3_thermal.c
index e1e4123..fdf16aa 100644 (file)
@@ -143,7 +143,7 @@ static void rcar_gen3_thermal_calc_coefs(struct rcar_gen3_thermal_tsc *tsc,
         * Division is not scaled in BSP and if scaled it might overflow
         * the dividend (4095 * 4095 << 14 > INT_MAX) so keep it unscaled
         */
-       tsc->tj_t = (FIXPT_INT((ptat[1] - ptat[2]) * 157)
+       tsc->tj_t = (FIXPT_INT((ptat[1] - ptat[2]) * (ths_tj_1 - TJ_3))
                     / (ptat[0] - ptat[2])) + FIXPT_INT(TJ_3);
 
        tsc->coef.a1 = FIXPT_DIV(FIXPT_INT(thcode[1] - thcode[2]),
@@ -307,7 +307,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
 {
        struct rcar_gen3_thermal_priv *priv;
        struct device *dev = &pdev->dev;
-       const int *rcar_gen3_ths_tj_1 = of_device_get_match_data(dev);
+       const int *ths_tj_1 = of_device_get_match_data(dev);
        struct resource *res;
        struct thermal_zone_device *zone;
        int ret, i;
@@ -352,8 +352,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
                priv->tscs[i] = tsc;
 
                priv->thermal_init(tsc);
-               rcar_gen3_thermal_calc_coefs(tsc, ptat, thcodes[i],
-                                            *rcar_gen3_ths_tj_1);
+               rcar_gen3_thermal_calc_coefs(tsc, ptat, thcodes[i], *ths_tj_1);
 
                zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,
                                                            &rcar_gen3_tz_of_ops);