Skip to content

Commit cf96921

Browse files
Ansueldlezcano
authored andcommitted
thermal/drivers/tsens: Fix wrong check for tzd in irq handlers
Some devices can have some thermal sensors disabled from the factory. The current two irq handler functions check all the sensor by default and the check if the sensor was actually registered is wrong. The tzd is actually never set if the registration fails hence the IS_ERR check is wrong. Signed-off-by: Ansuel Smith <[email protected]> Reviewed-by: Matthias Kaehlcke <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1bb30b2 commit cf96921

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/thermal/qcom/tsens.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ static irqreturn_t tsens_critical_irq_thread(int irq, void *data)
417417
const struct tsens_sensor *s = &priv->sensor[i];
418418
u32 hw_id = s->hw_id;
419419

420-
if (IS_ERR(s->tzd))
420+
if (!s->tzd)
421421
continue;
422422
if (!tsens_threshold_violated(priv, hw_id, &d))
423423
continue;
@@ -467,7 +467,7 @@ static irqreturn_t tsens_irq_thread(int irq, void *data)
467467
const struct tsens_sensor *s = &priv->sensor[i];
468468
u32 hw_id = s->hw_id;
469469

470-
if (IS_ERR(s->tzd))
470+
if (!s->tzd)
471471
continue;
472472
if (!tsens_threshold_violated(priv, hw_id, &d))
473473
continue;

0 commit comments

Comments
 (0)