usb: host: ehci-platform: BUG_ON() to WARN_ON() on probe
[pandora-kernel.git] / drivers / usb / host / ehci-platform.c
index dfe881a..a2aaef6 100644 (file)
@@ -82,10 +82,14 @@ static int __devinit ehci_platform_probe(struct platform_device *dev)
 {
        struct usb_hcd *hcd;
        struct resource *res_mem;
+       struct usb_ehci_pdata *pdata = dev->dev.platform_data;
        int irq;
        int err = -ENOMEM;
 
-       BUG_ON(!dev->dev.platform_data);
+       if (!pdata) {
+               WARN_ON(1);
+               return -ENODEV;
+       }
 
        if (usb_disabled())
                return -ENODEV;
@@ -153,17 +157,16 @@ static int __devexit ehci_platform_remove(struct platform_device *dev)
 static int ehci_platform_suspend(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
-       bool wakeup = device_may_wakeup(dev);
+       bool do_wakeup = device_may_wakeup(dev);
 
-       ehci_prepare_ports_for_controller_suspend(hcd_to_ehci(hcd), wakeup);
-       return 0;
+       return ehci_suspend(hcd, do_wakeup);
 }
 
 static int ehci_platform_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
 
-       ehci_prepare_ports_for_controller_resume(hcd_to_ehci(hcd));
+       ehci_resume(hcd, false);
        return 0;
 }