Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[powerpc.git] / drivers / usb / host / sl811-hcd.c
index a7722a6..6b4bc3f 100644 (file)
 #undef PACKET_TRACE
 
 #include <linux/config.h>
-
-#ifdef CONFIG_USB_DEBUG
-#      define DEBUG
-#else
-#      undef DEBUG
-#endif
-
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -53,7 +46,7 @@
 #include <linux/list.h>
 #include <linux/interrupt.h>
 #include <linux/usb.h>
-#include <linux/usb_sl811.h>
+#include <linux/usb/sl811.h>
 #include <linux/platform_device.h>
 
 #include <asm/io.h>
@@ -860,7 +853,7 @@ static int sl811h_urb_enqueue(
 
        } else {
                INIT_LIST_HEAD(&ep->schedule);
-               ep->udev = usb_get_dev(udev);
+               ep->udev = udev;
                ep->epnum = epnum;
                ep->maxpacket = usb_maxpacket(udev, urb->pipe, is_out);
                ep->defctrl = SL11H_HCTLMASK_ARM | SL11H_HCTLMASK_ENABLE;
@@ -1059,7 +1052,6 @@ sl811h_endpoint_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep)
        if (!list_empty(&hep->urb_list))
                WARN("ep %p not empty?\n", ep);
 
-       usb_put_dev(ep->udev);
        kfree(ep);
        hep->hcpriv = NULL;
 }
@@ -1581,7 +1573,9 @@ sl811h_start(struct usb_hcd *hcd)
        hcd->state = HC_STATE_RUNNING;
 
        if (sl811->board) {
-               hcd->can_wakeup = sl811->board->can_wakeup;
+               if (!device_can_wakeup(hcd->self.controller))
+                       device_init_wakeup(hcd->self.controller,
+                               sl811->board->can_wakeup);
                hcd->power_budget = sl811->board->power * 2;
        }
 
@@ -1805,9 +1799,10 @@ sl811h_resume(struct platform_device *dev)
         * let's assume it'd only be powered to enable remote wakeup.
         */
        if (dev->dev.power.power_state.event == PM_EVENT_SUSPEND
-                       || !hcd->can_wakeup) {
+                       || !device_can_wakeup(&hcd->self.root_hub->dev)) {
                sl811->port1 = 0;
                port_power(sl811, 1);
+               usb_root_hub_lost_power(hcd->self.root_hub);
                return 0;
        }