Skip to content

Commit

Permalink
thermal/drivers/tsens: Fix wrong check for tzd in irq handlers
Browse files Browse the repository at this point in the history
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 <ansuelsmth@gmail.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210907212543.20220-1-ansuelsmth@gmail.com
  • Loading branch information
Ansuel Smith authored and Daniel Lezcano committed Sep 21, 2021
1 parent 1bb30b2 commit cf96921
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/thermal/qcom/tsens.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ static irqreturn_t tsens_critical_irq_thread(int irq, void *data)
const struct tsens_sensor *s = &priv->sensor[i];
u32 hw_id = s->hw_id;

if (IS_ERR(s->tzd))
if (!s->tzd)
continue;
if (!tsens_threshold_violated(priv, hw_id, &d))
continue;
Expand Down Expand Up @@ -467,7 +467,7 @@ static irqreturn_t tsens_irq_thread(int irq, void *data)
const struct tsens_sensor *s = &priv->sensor[i];
u32 hw_id = s->hw_id;

if (IS_ERR(s->tzd))
if (!s->tzd)
continue;
if (!tsens_threshold_violated(priv, hw_id, &d))
continue;
Expand Down

0 comments on commit cf96921

Please sign in to comment.