Skip to content

Commit

Permalink
phy: stih41x-usb: Fixup stih41x_usb_phy_power_on failure path
Browse files Browse the repository at this point in the history
If stih41x_usb_phy_power_on() fails, we need to call clk_disable_unprepare()
before return error. This is to ensure we have balanced clk_enable/disable
calls.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Patrice Chotard <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
  • Loading branch information
AxelLin authored and kishon committed Mar 25, 2015
1 parent 739ae34 commit 080de5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/phy/phy-stih41x-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ static int stih41x_usb_phy_power_on(struct phy *phy)
return ret;
}

return regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg,
phy_dev->cfg->oscok, phy_dev->cfg->oscok);
ret = regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg,
phy_dev->cfg->oscok, phy_dev->cfg->oscok);
if (ret)
clk_disable_unprepare(phy_dev->clk);

return ret;
}

static int stih41x_usb_phy_power_off(struct phy *phy)
Expand Down

0 comments on commit 080de5b

Please sign in to comment.