[cocci] [PATCH 28/36] regulator: wm831x-isink: remove conditional return with no effect

Sang-Heon Jeon <[email protected]> Fri, 24 Jul 2026 03:45:30 +0900
Newsgroups fr.inria.cocci,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Both branches of the check return the same value, so the check has
no effect. Remove it and return the value directly.

This is the result of running the Coccinelle script from
scripts/coccinelle/misc/cond_return_no_effect.cocci.

Signed-off-by: Sang-Heon Jeon <[email protected]>
---
 drivers/regulator/wm831x-isink.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 43f220cea21c..b46e2cde5e9d 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -62,11 +62,7 @@ static int wm831x_isink_disable(struct regulator_dev *rdev)
 	if (ret < 0)
 		return ret;
 
-	ret = wm831x_set_bits(wm831x, isink->reg, WM831X_CS1_ENA, 0);
-	if (ret < 0)
-		return ret;
-
-	return ret;
+	return wm831x_set_bits(wm831x, isink->reg, WM831X_CS1_ENA, 0);
 
 }
 
-- 
2.43.0