提交 9ec602ec 编写于 作者: F Fabio Baltieri 提交者: Felipe Balbi

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: NKalle Jokiniemi <kalle.jokiniemi@jollamobile.com>
Signed-off-by: NFabio Baltieri <fabio.baltieri@linaro.org>
Signed-off-by: NFelipe Balbi <balbi@ti.com>
上级 88b1c78d
......@@ -384,9 +384,17 @@ static void __twl4030_phy_power(struct twl4030_usb *twl, int on)
static void twl4030_phy_power(struct twl4030_usb *twl, int on)
{
int ret;
if (on) {
regulator_enable(twl->usb3v1);
regulator_enable(twl->usb1v8);
ret = regulator_enable(twl->usb3v1);
if (ret)
dev_err(twl->dev, "Failed to enable usb3v1\n");
ret = regulator_enable(twl->usb1v8);
if (ret)
dev_err(twl->dev, "Failed to enable usb1v8\n");
/*
* Disabling usb3v1 regulator (= writing 0 to VUSB3V1_DEV_GRP
* in twl4030) resets the VUSB_DEDICATED2 register. This reset
......@@ -395,7 +403,11 @@ static void twl4030_phy_power(struct twl4030_usb *twl, int on)
* is re-activated. This ensures that VUSB3V1 is really active.
*/
twl_i2c_write_u8(TWL_MODULE_PM_RECEIVER, 0, VUSB_DEDICATED2);
regulator_enable(twl->usb1v5);
ret = regulator_enable(twl->usb1v5);
if (ret)
dev_err(twl->dev, "Failed to enable usb1v5\n");
__twl4030_phy_power(twl, 1);
twl4030_usb_write(twl, PHY_CLK_CTRL,
twl4030_usb_read(twl, PHY_CLK_CTRL) |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册