power: max77693: fix simple_return.cocci warnings

Author: kbuild test robot <fengguang.wu@intel.com>

drivers/power/max77693_charger.c:615:1-4: WARNING: end returns can be simpified

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.
Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Krzysztof Kozlowski 
Signed-off-by: Fengguang Wu 
Reviewed-by: Krzysztof Kozlowski 
Signed-off-by: Sebastian Reichel 
---
 drivers/power/max77693_charger.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
 
diff --git a/drivers/power/max77693_charger.c b/drivers/power/max77693_charger.c
index 56cf217..841047c 100644
--- a/drivers/power/max77693_charger.c
+++ b/drivers/power/max77693_charger.c
@@ -612,12 +612,8 @@ static int max77693_reg_init(struct max77693_charger *chg)
 	if (ret)
 		return ret;
 
-	ret = max77693_set_charge_input_threshold_volt(chg,
+	return max77693_set_charge_input_threshold_volt(chg,
 			chg->charge_input_threshold_volt);
-	if (ret)
-		return ret;
-
-	return 0;
 }
 
 #ifdef CONFIG_OF
BtrLinux
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.