Skip to contentSkip to conversation

phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path

PATCH New Axel Lin 1 participant 1 message Mar 4, 2015

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/phy/phy-rockchip-usb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/phy/phy-rockchip-usb.c +3 -3
index 22011c3..7d4c336 100644
@@ -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;
 }
Signature · 1 line
1.9.1