diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2021-09-08 00:25:42 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-10-09 15:40:57 +0300 |
commit | 2e28f7dd3743bf8f386fa72b96e5da2898039df5 (patch) | |
tree | 77d34fbca4fb82defbcc910992074fb1b0522daa /drivers/thermal | |
parent | 7a670cfb0f4cba692a2cc0caa60810986ceeab3d (diff) | |
download | linux-2e28f7dd3743bf8f386fa72b96e5da2898039df5.tar.xz |
thermal/drivers/tsens: Fix wrong check for tzd in irq handlers
[ Upstream commit cf96921876dcee4d6ac07b9de470368a075ba9ad ]
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
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/qcom/tsens.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/thermal/qcom/tsens.c b/drivers/thermal/qcom/tsens.c index 3c4c0516e58a..cb4f4b522446 100644 --- a/drivers/thermal/qcom/tsens.c +++ b/drivers/thermal/qcom/tsens.c @@ -415,7 +415,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; @@ -465,7 +465,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; |