[PATCH 3/3] phy: twl4030-usb: propagate actual error on regulator lookup

From: Uwe Kleine-KÃnig
Date: Thu May 25 2017 - 15:59:11 EST


devm_regulator_get returns an error code, return this one to the caller
instead of -ENODEV. This fixes deferred probe.

Fixes: 6747caa76cab ("usb: phy: twl4030: use the new generic PHY framework")
Signed-off-by: Uwe Kleine-KÃnig <u.kleine-koenig@xxxxxxxxxxxxxx>
---
drivers/phy/phy-twl4030-usb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/phy-twl4030-usb.c b/drivers/phy/phy-twl4030-usb.c
index 6aefbd55fcee..422232aac0b2 100644
--- a/drivers/phy/phy-twl4030-usb.c
+++ b/drivers/phy/phy-twl4030-usb.c
@@ -499,7 +499,7 @@ static int twl4030_usb_ldo_init(struct twl4030_usb *twl)

twl->usb3v1 = devm_regulator_get(twl->dev, "usb3v1");
if (IS_ERR(twl->usb3v1))
- return -ENODEV;
+ return PTR_ERR(twl->usb3v1);

twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB3V1_TYPE);

@@ -508,7 +508,7 @@ static int twl4030_usb_ldo_init(struct twl4030_usb *twl)

twl->usb1v5 = devm_regulator_get(twl->dev, "usb1v5");
if (IS_ERR(twl->usb1v5))
- return -ENODEV;
+ return PTR_ERR(twl->usb1v5);

twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB1V5_TYPE);

@@ -517,7 +517,7 @@ static int twl4030_usb_ldo_init(struct twl4030_usb *twl)

twl->usb1v8 = devm_regulator_get(twl->dev, "usb1v8");
if (IS_ERR(twl->usb1v8))
- return -ENODEV;
+ return PTR_ERR(twl->usb1v8);

twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB1V8_TYPE);

--
2.11.0