[PATCH 1/4] thermal/drivers/qcom: Simplify returns for tsens-8060.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Simplify return logic in file tsens-8060.c.

Signed-off-by: Carlos Bilbao <carlos.bilbao@xxxxxxx>
---
 drivers/thermal/qcom/tsens-8960.c | 24 ++++--------------------
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/drivers/thermal/qcom/tsens-8960.c b/drivers/thermal/qcom/tsens-8960.c
index 8d9b721dadb6..f4fc8a1c161e 100644
--- a/drivers/thermal/qcom/tsens-8960.c
+++ b/drivers/thermal/qcom/tsens-8960.c
@@ -75,11 +75,7 @@ static int suspend_8960(struct tsens_priv *priv)
 	else
 		mask = SLP_CLK_ENA_8660 | EN;
 
-	ret = regmap_update_bits(map, CNTL_ADDR, mask, 0);
-	if (ret)
-		return ret;
-
-	return 0;
+	return regmap_update_bits(map, CNTL_ADDR, mask, 0);
 }
 
 static int resume_8960(struct tsens_priv *priv)
@@ -105,11 +101,7 @@ static int resume_8960(struct tsens_priv *priv)
 	if (ret)
 		return ret;
 
-	ret = regmap_write(map, CNTL_ADDR, priv->ctx.control);
-	if (ret)
-		return ret;
-
-	return 0;
+	return regmap_write(map, CNTL_ADDR, priv->ctx.control);
 }
 
 static int enable_8960(struct tsens_priv *priv, int id)
@@ -131,11 +123,7 @@ static int enable_8960(struct tsens_priv *priv, int id)
 	else
 		reg |= mask | SLP_CLK_ENA_8660 | EN;
 
-	ret = regmap_write(priv->tm_map, CNTL_ADDR, reg);
-	if (ret)
-		return ret;
-
-	return 0;
+	return regmap_write(priv->tm_map, CNTL_ADDR, reg);
 }
 
 static void disable_8960(struct tsens_priv *priv)
@@ -205,11 +193,7 @@ static int init_8960(struct tsens_priv *priv)
 		return ret;
 
 	reg_cntl |= EN;
-	ret = regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl);
-	if (ret)
-		return ret;
-
-	return 0;
+	return regmap_write(priv->tm_map, CNTL_ADDR, reg_cntl);
 }
 
 static int calibrate_8960(struct tsens_priv *priv)
-- 
2.31.1




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux