public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path
@ 2015-03-04  1:33 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2015-03-04  1:33 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Yunzhi Li, Doug Anderson, Heiko Stuebner, linux-rockchip,
	linux-kernel

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>
---
 drivers/phy/phy-rockchip-usb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/phy/phy-rockchip-usb.c b/drivers/phy/phy-rockchip-usb.c
index 22011c3..7d4c336 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;
 }
-- 
1.9.1




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-04  1:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04  1:33 [PATCH] phy: rockchip-usb: Fixup rockchip_usb_phy_power_on failure path Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox