From: Mian Yousaf Kaukab <[email protected]>

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

Reported-by: Sakethram Bommisetti <[email protected]>
Signed-off-by: Mian Yousaf Kaukab <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Fabio Baltieri <[email protected]>
---
 drivers/usb/phy/phy-ab8500-usb.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

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);
 
-- 
1.8.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to