Unverified Commit 670500b4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown
Browse files

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: 3ce6f4f9 ("regulator: pca9450: Fix control register for LDO5")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aSBqnPoBrsNB1Ale@stanley.mountain


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f1c66826
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1401,10 +1401,9 @@ static int pca9450_i2c_probe(struct i2c_client *i2c)
	 * to this signal (if SION bit is set in IOMUX).
	 */
	pca9450->sd_vsel_gpio = gpiod_get_optional(&ldo5->dev, "sd-vsel", GPIOD_IN);
	if (IS_ERR(pca9450->sd_vsel_gpio)) {
		dev_err(&i2c->dev, "Failed to get SD_VSEL GPIO\n");
		return ret;
	}
	if (IS_ERR(pca9450->sd_vsel_gpio))
		return dev_err_probe(&i2c->dev, PTR_ERR(pca9450->sd_vsel_gpio),
				     "Failed to get SD_VSEL GPIO\n");

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