Skip to content

Commit 76a5c40

Browse files
Anson-Huangdlezcano
authored andcommitted
thermal: imx8mm: Fix build warning of incorrect argument type
Fix below sparse warning: drivers/thermal/imx8mm_thermal.c:82:36: sparse: sparse: incorrect type in argument 2 (different address spaces), expected unsigned long const volatile *addr drivers/thermal/imx8mm_thermal.c:82:36: sparse: expected unsigned long const volatile *addr Signed-off-by: Anson Huang <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 40ea568 commit 76a5c40

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/thermal/imx8mm_thermal.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,14 @@ static int imx8mp_tmu_get_temp(void *data, int *temp)
7575
{
7676
struct tmu_sensor *sensor = data;
7777
struct imx8mm_tmu *tmu = sensor->priv;
78+
unsigned long val;
7879
bool ready;
79-
u32 val;
8080

81-
ready = test_bit(probe_status_offset(sensor->hw_id),
82-
tmu->base + TRITSR);
81+
val = readl_relaxed(tmu->base + TRITSR);
82+
ready = test_bit(probe_status_offset(sensor->hw_id), &val);
8383
if (!ready)
8484
return -EAGAIN;
8585

86-
val = readl_relaxed(tmu->base + TRITSR);
8786
val = sensor->hw_id ? FIELD_GET(TRITSR_TEMP1_VAL_MASK, val) :
8887
FIELD_GET(TRITSR_TEMP0_VAL_MASK, val);
8988
if (val & SIGN_BIT) /* negative */

0 commit comments

Comments
 (0)