Commit f592cf62 authored by Amelie Delaunay's avatar Amelie Delaunay Committed by Lee Jones

mfd: stmfx: Fix error path in stmfx_chip_init

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: 06252ade ("mfd: Add ST Multi-Function eXpander (STMFX) core driver")
Signed-off-by: default avatarAmelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20230609092804.793100-1-amelie.delaunay@foss.st.comSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent d918e0d5
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment