Skip to content

Commit 670500b

Browse files
Dan Carpenterbroonie
authored andcommitted
regulator: pca9450: Fix error code in probe()
Return "PTR_ERR(pca9450->sd_vsel_gpio)" instead of "ret". The "ret" variable is success at this point. Fixes: 3ce6f4f ("regulator: pca9450: Fix control register for LDO5") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://patch.msgid.link/aSBqnPoBrsNB1Ale@stanley.mountain Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent f1c6682 commit 670500b

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

drivers/regulator/pca9450-regulator.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,10 +1401,9 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
14011401
* to this signal (if SION bit is set in IOMUX).
14021402
*/
14031403
pca9450->sd_vsel_gpio = gpiod_get_optional(&ldo5->dev, "sd-vsel", GPIOD_IN);
1404-
if (IS_ERR(pca9450->sd_vsel_gpio)) {
1405-
dev_err(&i2c->dev, "Failed to get SD_VSEL GPIO\n");
1406-
return ret;
1407-
}
1404+
if (IS_ERR(pca9450->sd_vsel_gpio))
1405+
return dev_err_probe(&i2c->dev, PTR_ERR(pca9450->sd_vsel_gpio),
1406+
"Failed to get SD_VSEL GPIO\n");
14081407

14091408
pca9450->sd_vsel_fixed_low =
14101409
of_property_read_bool(ldo5->dev.of_node, "nxp,sd-vsel-fixed-low");

0 commit comments

Comments
 (0)