Commit cf969218 authored by Ansuel Smith's avatar Ansuel Smith Committed by Daniel Lezcano

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: default avatarAnsuel Smith <ansuelsmth@gmail.com>
Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210907212543.20220-1-ansuelsmth@gmail.com
parent 1bb30b20
...@@ -417,7 +417,7 @@ static irqreturn_t tsens_critical_irq_thread(int irq, void *data) ...@@ -417,7 +417,7 @@ static irqreturn_t tsens_critical_irq_thread(int irq, void *data)
const struct tsens_sensor *s = &priv->sensor[i]; const struct tsens_sensor *s = &priv->sensor[i];
u32 hw_id = s->hw_id; u32 hw_id = s->hw_id;
if (IS_ERR(s->tzd)) if (!s->tzd)
continue; continue;
if (!tsens_threshold_violated(priv, hw_id, &d)) if (!tsens_threshold_violated(priv, hw_id, &d))
continue; continue;
...@@ -467,7 +467,7 @@ static irqreturn_t tsens_irq_thread(int irq, void *data) ...@@ -467,7 +467,7 @@ static irqreturn_t tsens_irq_thread(int irq, void *data)
const struct tsens_sensor *s = &priv->sensor[i]; const struct tsens_sensor *s = &priv->sensor[i];
u32 hw_id = s->hw_id; u32 hw_id = s->hw_id;
if (IS_ERR(s->tzd)) if (!s->tzd)
continue; continue;
if (!tsens_threshold_violated(priv, hw_id, &d)) if (!tsens_threshold_violated(priv, hw_id, &d))
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment