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-Url: https://git.stricted.de/?a=commitdiff_plain;h=f5ef7b42823945d979ebd957e79bf66dc6a5e3d1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.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);