lkml.org 
[lkml]   [2022]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/4] thermal/drivers/qcom: Simplify function calibrate_8960()
Date
Simply function calibrate_8960() so a second check to IS_ERR(data) may be
avoided.

Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
---
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
\
 
 \ /
  Last update: 2022-07-13 16:58    [W:0.439 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site