lede/target/linux/ipq807x/patches-5.10/153-drivers-thermal-tsens-fix-wrong-check-for-tzd-in-irq.patch
2021-06-24 12:16:06 +08:00

38 lines
1.2 KiB
Diff

From 10f0582cd0f7c1f3387229f5d341a5ef10a53556 Mon Sep 17 00:00:00 2001
From: Ansuel Smith <ansuelsmth@gmail.com>
Date: Wed, 19 May 2021 00:46:26 +0200
Subject: [PATCH 1/2] drivers: thermal: tsens: fix wrong check for tzd in irq
handlers
Some device can have some thermal sensor disabled from the factory. The
current 2 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 fail hence the IS_ERR check is
wrong.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
drivers/thermal/qcom/tsens.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/thermal/qcom/tsens.c
+++ b/drivers/thermal/qcom/tsens.c
@@ -421,7 +421,7 @@ static irqreturn_t tsens_critical_irq_th
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;
@@ -471,7 +471,7 @@ static irqreturn_t tsens_irq_thread(int
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;