diff mbox

[08/12] usb: phy: ab8500-usb: fix unbalanced clock and regulator disable warnings

Message ID 1364978713-19612-9-git-send-email-fabio.baltieri@linaro.org
State Accepted
Commit f5ef7b42823945d979ebd957e79bf66dc6a5e3d1
Headers show

Commit Message

Fabio Baltieri April 3, 2013, 8:45 a.m. UTC
From: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>

To prevent clock and regulator frameworks from complaining, only disable
the host or peripheral phy if they were enabled.

Reported-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com>
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---
 drivers/usb/phy/phy-ab8500-usb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c
index 803ad93..b7f6639 100644
--- a/drivers/usb/phy/phy-ab8500-usb.c
+++ b/drivers/usb/phy/phy-ab8500-usb.c
@@ -887,8 +887,10 @@  static int ab8500_usb_remove(struct platform_device *pdev)
 
 	usb_remove_phy(&ab->phy);
 
-	ab8500_usb_host_phy_dis(ab);
-	ab8500_usb_peri_phy_dis(ab);
+	if (ab->mode == USB_HOST)
+		ab8500_usb_host_phy_dis(ab);
+	else if (ab->mode == USB_PERIPHERAL)
+		ab8500_usb_peri_phy_dis(ab);
 
 	platform_set_drvdata(pdev, NULL);