Skip to content

Commit

Permalink
phy: lpc18xx-usb-otg: error handling in lpc18xx_usb_otg_phy_power_on()
Browse files Browse the repository at this point in the history
If regmap_update_bits() fails in lpc18xx_usb_otg_phy_power_on(),
lpc->clk is left enabled.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
  • Loading branch information
khoroshilov authored and kishon committed Mar 16, 2018
1 parent d711922 commit 124380c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/phy/phy-lpc18xx-usb-otg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 124380c

Please sign in to comment.