Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 3ce6f4f943dd ("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>

authored by

Dan Carpenter and committed by
Mark Brown
670500b4 f1c66826

+3 -4
+3 -4
drivers/regulator/pca9450-regulator.c
··· 1401 1401 * to this signal (if SION bit is set in IOMUX). 1402 1402 */ 1403 1403 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"); 1408 1407 1409 1408 pca9450->sd_vsel_fixed_low = 1410 1409 of_property_read_bool(ldo5->dev.of_node, "nxp,sd-vsel-fixed-low");