Skip to content

Commit 106e012

Browse files
Stefan Wahrendlezcano
authored andcommitted
thermal/drivers/bcm2711: Don't clamp temperature at zero
The thermal sensor on BCM2711 is capable of negative temperatures, so don't clamp the measurements at zero. Since this was the only use for variable t, drop it. This change based on a patch by Dom Cobley, who also tested the fix. Fixes: 59b7813 ("thermal: Add BCM2711 thermal driver") Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20220412195423.104511-1-stefan.wahren@i2se.com Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent 2caf739 commit 106e012

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

drivers/thermal/broadcom/bcm2711_thermal.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ static int bcm2711_get_temp(void *data, int *temp)
3838
int offset = thermal_zone_get_offset(priv->thermal);
3939
u32 val;
4040
int ret;
41-
long t;
4241

4342
ret = regmap_read(priv->regmap, AVS_RO_TEMP_STATUS, &val);
4443
if (ret)
@@ -50,9 +49,7 @@ static int bcm2711_get_temp(void *data, int *temp)
5049
val &= AVS_RO_TEMP_STATUS_DATA_MSK;
5150

5251
/* Convert a HW code to a temperature reading (millidegree celsius) */
53-
t = slope * val + offset;
54-
55-
*temp = t < 0 ? 0 : t;
52+
*temp = slope * val + offset;
5653

5754
return 0;
5855
}

0 commit comments

Comments
 (0)