aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-03-16 20:39:01 -0400
committerKishon Vijay Abraham I <kishon@ti.com>2015-03-25 19:36:09 -0400
commit080de5ba390c54b7504c43b36ae21911acf66b30 (patch)
tree65ae710b35ff71025efe3738119b3f9ff108fb5c /drivers/phy
parent739ae3452d0ee199b3cfe5e52214d9ccd8e358ea (diff)
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>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-stih41x-usb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/phy/phy-stih41x-usb.c b/drivers/phy/phy-stih41x-usb.c
index a603801293ff..c093b472b57d 100644
--- a/drivers/phy/phy-stih41x-usb.c
+++ b/drivers/phy/phy-stih41x-usb.c
@@ -87,8 +87,12 @@ static int stih41x_usb_phy_power_on(struct phy *phy)
87 return ret; 87 return ret;
88 } 88 }
89 89
90 return regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg, 90 ret = regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg,
91 phy_dev->cfg->oscok, phy_dev->cfg->oscok); 91 phy_dev->cfg->oscok, phy_dev->cfg->oscok);
92 if (ret)
93 clk_disable_unprepare(phy_dev->clk);
94
95 return ret;
92} 96}
93 97
94static int stih41x_usb_phy_power_off(struct phy *phy) 98static int stih41x_usb_phy_power_off(struct phy *phy)