Skip to content

Commit 99c47fc

Browse files
David HERNANDEZ SANCHEZEduardo Valentin
authored andcommitted
thermal: stm32: Fix stm_thermal_read_factory_settings
Adding brackets allows to multiply the register value, masked by TS1_RAMP_COEFF_MASK, by an ADJUST value properly and not to multiply ADJUST by register value and then mask the whole. Fixes: 1d69315 ("thermal: add stm32 thermal driver") Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: David Hernandez Sanchez <david.hernandezsanchez@st.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
1 parent 3c9d082 commit 99c47fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/thermal/st/stm_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ static int stm_thermal_read_factory_settings(struct stm_thermal_sensor *sensor)
241241
sensor->t0 = TS1_T0_VAL1;
242242

243243
/* Retrieve fmt0 and put it on Hz */
244-
sensor->fmt0 = ADJUST * readl_relaxed(sensor->base + DTS_T0VALR1_OFFSET)
245-
& TS1_FMT0_MASK;
244+
sensor->fmt0 = ADJUST * (readl_relaxed(sensor->base +
245+
DTS_T0VALR1_OFFSET) & TS1_FMT0_MASK);
246246

247247
/* Retrieve ramp coefficient */
248248
sensor->ramp_coeff = readl_relaxed(sensor->base + DTS_RAMPVALR_OFFSET) &

0 commit comments

Comments
 (0)