1
0
Fork 0

phy: stih41x-usb: Fixup stih41x_usb_phy_power_on failure path

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 <axel.lin@ingics.com>
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
hifive-unleashed-5.1
Axel Lin 2015-03-17 08:39:01 +08:00 committed by Kishon Vijay Abraham I
parent 739ae3452d
commit 080de5ba39
1 changed files with 6 additions and 2 deletions

View File

@ -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)