mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
mfd: stmfx: Fix dev_err_probe() call in stmfx_chip_init()
[ Upstream commitd75846ed08] 'ret' may be 0 so, dev_err_probe() should be called only when 'ret' is an error code. Fixes:41c9c06c49("mfd: stmfx: Simplify with dev_err_probe()") Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b278cdb100
commit
de39384806
@@ -329,11 +329,11 @@ static int stmfx_chip_init(struct i2c_client *client)
|
||||
|
||||
stmfx->vdd = devm_regulator_get_optional(&client->dev, "vdd");
|
||||
ret = PTR_ERR_OR_ZERO(stmfx->vdd);
|
||||
if (ret == -ENODEV) {
|
||||
stmfx->vdd = NULL;
|
||||
} else {
|
||||
return dev_err_probe(&client->dev, ret,
|
||||
"Failed to get VDD regulator\n");
|
||||
if (ret) {
|
||||
if (ret == -ENODEV)
|
||||
stmfx->vdd = NULL;
|
||||
else
|
||||
return dev_err_probe(&client->dev, ret, "Failed to get VDD regulator\n");
|
||||
}
|
||||
|
||||
if (stmfx->vdd) {
|
||||
|
||||
Reference in New Issue
Block a user