summaryrefslogtreecommitdiffstats
path: root/drivers/phy
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-03-04 09:33:32 +0800
committerKishon Vijay Abraham I <kishon@ti.com>2015-03-12 11:01:17 +0530
commit6b08e36ba32b3cb4d44af617c8984f9c2bfdf964 (patch)
tree9100d38a29c9d9f7e4135ed533ed15a54717f191 /drivers/phy
parenta5e5d3c0b239a67d712995f37140e354b5547003 (diff)
downloadlinux-6b08e36ba32b3cb4d44af617c8984f9c2bfdf964.tar.bz2
phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path
If rockchip_usb_phy_power() fails, we need to call clk_disable_unprepare() before return. This is to ensure we have balanced clk_enable/disable calls. Also remove unneeded ret checking in rockchip_usb_phy_power_off. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/phy-rockchip-usb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/phy/phy-rockchip-usb.c b/drivers/phy/phy-rockchip-usb.c
index 22011c3b6a4b..7d4c33643768 100644
--- a/drivers/phy/phy-rockchip-usb.c
+++ b/drivers/phy/phy-rockchip-usb.c
@@ -61,8 +61,6 @@ static int rockchip_usb_phy_power_off(struct phy *_phy)
return ret;
clk_disable_unprepare(phy->clk);
- if (ret)
- return ret;
return 0;
}
@@ -78,8 +76,10 @@ static int rockchip_usb_phy_power_on(struct phy *_phy)
/* Power up usb phy analog blocks by set siddq 0 */
ret = rockchip_usb_phy_power(phy, 0);
- if (ret)
+ if (ret) {
+ clk_disable_unprepare(phy->clk);
return ret;
+ }
return 0;
}