diff options
author | Fabio Baltieri <fabio.baltieri@linaro.org> | 2013-04-03 10:02:26 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-04-03 11:44:38 -0400 |
commit | 9ec602ecb199653a16e1eb909551b7ba77d79922 (patch) | |
tree | 539ccc1297734c24dd9efef139944e6041987255 | |
parent | 88b1c78db32782041d9548e3c4ab405f9e9eab59 (diff) |
usb: phy: twl4030-usb: check regulator_enable return value
Since regulator_enable() is going to be marked as __must_check in the
next merge window, always check regulator_enable() return value and
print a warning if it fails.
Reviewed-by: Kalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/phy/phy-twl4030-usb.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/usb/phy/phy-twl4030-usb.c b/drivers/usb/phy/phy-twl4030-usb.c index 3f9858fbebc2..13e17ae5ecd9 100644 --- a/drivers/usb/phy/phy-twl4030-usb.c +++ b/drivers/usb/phy/phy-twl4030-usb.c | |||
@@ -384,9 +384,17 @@ static void __twl4030_phy_power(struct twl4030_usb *twl, int on) | |||
384 | 384 | ||
385 | static void twl4030_phy_power(struct twl4030_usb *twl, int on) | 385 | static void twl4030_phy_power(struct twl4030_usb *twl, int on) |
386 | { | 386 | { |
387 | int ret; | ||
388 | |||
387 | if (on) { | 389 | if (on) { |
388 | regulator_enable(twl->usb3v1); | 390 | ret = regulator_enable(twl->usb3v1); |
389 | regulator_enable(twl->usb1v8); | 391 | if (ret) |
392 | dev_err(twl->dev, "Failed to enable usb3v1\n"); | ||
393 | |||
394 | ret = regulator_enable(twl->usb1v8); | ||
395 | if (ret) | ||
396 | dev_err(twl->dev, "Failed to enable usb1v8\n"); | ||
397 | |||
390 | /* | 398 | /* |
391 | * Disabling usb3v1 regulator (= writing 0 to VUSB3V1_DEV_GRP | 399 | * Disabling usb3v1 regulator (= writing 0 to VUSB3V1_DEV_GRP |
392 | * in twl4030) resets the VUSB_DEDICATED2 register. This reset | 400 | * in twl4030) resets the VUSB_DEDICATED2 register. This reset |
@@ -395,7 +403,11 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on) | |||
395 | * is re-activated. This ensures that VUSB3V1 is really active. | 403 | * is re-activated. This ensures that VUSB3V1 is really active. |
396 | */ | 404 | */ |
397 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); | 405 | twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2); |
398 | regulator_enable(twl->usb1v5); | 406 | |
407 | ret = regulator_enable(twl->usb1v5); | ||
408 | if (ret) | ||
409 | dev_err(twl->dev, "Failed to enable usb1v5\n"); | ||
410 | |||
399 | __twl4030_phy_power(twl, 1); | 411 | __twl4030_phy_power(twl, 1); |
400 | twl4030_usb_write(twl, PHY_CLK_CTRL, | 412 | twl4030_usb_write(twl, PHY_CLK_CTRL, |
401 | twl4030_usb_read(twl, PHY_CLK_CTRL) | | 413 | twl4030_usb_read(twl, PHY_CLK_CTRL) | |