summaryrefslogtreecommitdiffstats
path: root/drivers/phy/phy-lpc18xx-usb-otg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/phy/phy-lpc18xx-usb-otg.c')
-rw-r--r--drivers/phy/phy-lpc18xx-usb-otg.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/phy/phy-lpc18xx-usb-otg.c b/drivers/phy/phy-lpc18xx-usb-otg.c
index 3b7a71eb5b7e..7de280a45421 100644
--- a/drivers/phy/phy-lpc18xx-usb-otg.c
+++ b/drivers/phy/phy-lpc18xx-usb-otg.c
@@ -60,8 +60,14 @@ static int lpc18xx_usb_otg_phy_power_on(struct phy *phy)
return ret;
/* The bit in CREG is cleared to enable the PHY */
- return regmap_update_bits(lpc->reg, LPC18XX_CREG_CREG0,
+ ret = regmap_update_bits(lpc->reg, LPC18XX_CREG_CREG0,
LPC18XX_CREG_CREG0_USB0PHY, 0);
+ if (ret) {
+ clk_disable(lpc->clk);
+ return ret;
+ }
+
+ return 0;
}
static int lpc18xx_usb_otg_phy_power_off(struct phy *phy)