===================================================================
@@ -674,8 +674,18 @@ ohci_hcd_at91_drv_suspend(struct platfor
{
struct usb_hcd *hcd = platform_get_drvdata(pdev);
struct ohci_hcd *ohci = hcd_to_ohci(hcd);
+ bool do_wakeup = device_may_wakeup(&pdev->dev);
+ int ret;
- if (device_may_wakeup(&pdev->dev))
+ ret = ohci_suspend(hcd, do_wakeup);
+ if (ret == 0 && do_wakeup && HCD_WAKEUP_PENDING(hcd)) {
+ ohci_resume(hcd, false);
+ ret = -EBUSY;
+ }
+ if (ret)
+ return ret;
+
+ if (do_wakeup)
enable_irq_wake(hcd->irq);
/*
@@ -692,7 +702,7 @@ ohci_hcd_at91_drv_suspend(struct platfor
at91_stop_clock();
}
- return 0;
+ return ret;
}
static int ohci_hcd_at91_drv_resume(struct platform_device *pdev)