2022-07-13 15:55:45

by Bilbao, Carlos

[permalink] [raw]
Subject: [PATCH 3/4] thermal/drivers/qcom: Simplify function calibrate_8960()

Simply function calibrate_8960() so a second check to IS_ERR(data) may be
avoided.

Signed-off-by: Carlos Bilbao <[email protected]>
---
drivers/thermal/qcom/tsens-8960.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c
index f4fc8a1c161e..b41ff164e67a 100644
--- a/drivers/thermal/qcom/tsens-8960.c
+++ b/drivers/thermal/qcom/tsens-8960.c
@@ -205,10 +205,11 @@ static int calibrate_8960(struct tsens_priv *priv)
struct tsens_sensor *s = priv->sensor;

data = qfprom_read(priv->dev, "calib");
- if (IS_ERR(data))
+ if (IS_ERR(data)) {
data = qfprom_read(priv->dev, "calib_backup");
- if (IS_ERR(data))
- return PTR_ERR(data);
+ if (IS_ERR(data))
+ return PTR_ERR(data);
+ }

for (i = 0; i < num_read; i++, s++)
s->offset = data[i];
--
2.31.1