diff mbox series

[RESEND,1/2] mfd: stmfx: Fix error path in stmfx_chip_init

Message ID 20230609092804.793100-1-amelie.delaunay@foss.st.com (mailing list archive)
State New, archived
Headers show
Series [RESEND,1/2] mfd: stmfx: Fix error path in stmfx_chip_init | expand

Commit Message

Amelie Delaunay June 9, 2023, 9:28 a.m. UTC
In error path, disable vdd regulator if it exists, but don't overload ret.
Because if regulator_disable() is successful, stmfx_chip_init will exit
successfully while chip init failed.

Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
---
 drivers/mfd/stmfx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lee Jones June 15, 2023, 2:05 p.m. UTC | #1
On Fri, 09 Jun 2023, Amelie Delaunay wrote:

> In error path, disable vdd regulator if it exists, but don't overload ret.
> Because if regulator_disable() is successful, stmfx_chip_init will exit
> successfully while chip init failed.
> 
> Fixes: 06252ade9156 ("mfd: Add ST Multi-Function eXpander (STMFX) core driver")
> Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
> ---
>  drivers/mfd/stmfx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks
diff mbox series

Patch

diff --git a/drivers/mfd/stmfx.c b/drivers/mfd/stmfx.c
index f30c7c304147..54cc902cb578 100644
--- a/drivers/mfd/stmfx.c
+++ b/drivers/mfd/stmfx.c
@@ -387,7 +387,7 @@  static int stmfx_chip_init(struct i2c_client *client)
 
 err:
 	if (stmfx->vdd)
-		return regulator_disable(stmfx->vdd);
+		regulator_disable(stmfx->vdd);
 
 	return ret;
 }