phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path
authorAxel Lin <axel.lin@ingics.com>
Wed, 4 Mar 2015 01:33:32 +0000 (09:33 +0800)
committerKishon Vijay Abraham I <kishon@ti.com>
Thu, 12 Mar 2015 05:31:17 +0000 (11:01 +0530)
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>
drivers/phy/phy-rockchip-usb.c

index 22011c3b6a4bbdc3a3734a3ca27c665fcf099de8..7d4c33643768808780f71455900bc7dd51329103 100644 (file)
@@ -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;
 }