From: Mian Yousaf Kaukab Date: Wed, 3 Apr 2013 08:45:09 +0000 (+0200) Subject: usb: phy: ab8500-usb: fix unbalanced clock and regulator disable warnings X-Git-Tag: next-20130404~27^2~21 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f5ef7b42823945d979ebd957e79bf66dc6a5e3d1;p=karo-tx-linux.git usb: phy: ab8500-usb: fix unbalanced clock and regulator disable warnings To prevent clock and regulator frameworks from complaining, only disable the host or peripheral phy if they were enabled. Reported-by: Sakethram Bommisetti Signed-off-by: Mian Yousaf Kaukab Acked-by: Linus Walleij Signed-off-by: Fabio Baltieri Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 96b4854f25df..fec260ee67d3 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c @@ -888,8 +888,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);