mfd: stmfx: Nullify stmfx->vdd in case of error
authorAmelie Delaunay <amelie.delaunay@foss.st.com>
Fri, 9 Jun 2023 09:28:04 +0000 (11:28 +0200)
committerLee Jones <lee@kernel.org>
Thu, 15 Jun 2023 14:05:49 +0000 (15:05 +0100)
commit7c81582c0bccb4757186176f0ee12834597066ad
treef3ce6c62228003039c55fd32b4955eb27b6c9d57
parentf592cf624531286f8b52e40dcfc157a5a7fb115c
mfd: stmfx: Nullify stmfx->vdd in case of error

Nullify stmfx->vdd in case devm_regulator_get_optional() returns an error.
And simplify code by returning an error only if return code is not -ENODEV,
which means there is no vdd regulator and it is not an issue.

Fixes: d75846ed08e6 ("mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20230609092804.793100-2-amelie.delaunay@foss.st.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/stmfx.c