]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/host/uhci-hcd.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6-omap-h63xx.git] / drivers / usb / host / uhci-hcd.c
index fec9872dd9dc83d5bbc90d0d780c1419b67ec009..d3e0d8aa398078f7c5c15313f19f656202dcafaa 100644 (file)
@@ -262,20 +262,12 @@ __acquires(uhci->lock)
 {
        int auto_stop;
        int int_enable, egsm_enable;
+       struct usb_device *rhdev = uhci_to_hcd(uhci)->self.root_hub;
 
        auto_stop = (new_state == UHCI_RH_AUTO_STOPPED);
-       dev_dbg(&uhci_to_hcd(uhci)->self.root_hub->dev,
-                       "%s%s\n", __FUNCTION__,
+       dev_dbg(&rhdev->dev, "%s%s\n", __func__,
                        (auto_stop ? " (auto-stop)" : ""));
 
-       /* If we get a suspend request when we're already auto-stopped
-        * then there's nothing to do.
-        */
-       if (uhci->rh_state == UHCI_RH_AUTO_STOPPED) {
-               uhci->rh_state = new_state;
-               return;
-       }
-
        /* Enable resume-detect interrupts if they work.
         * Then enter Global Suspend mode if _it_ works, still configured.
         */
@@ -285,8 +277,10 @@ __acquires(uhci->lock)
        if (remote_wakeup_is_broken(uhci))
                egsm_enable = 0;
        if (resume_detect_interrupts_are_broken(uhci) || !egsm_enable ||
-                       !device_may_wakeup(
-                               &uhci_to_hcd(uhci)->self.root_hub->dev))
+#ifdef CONFIG_PM
+                       (!auto_stop && !rhdev->do_remote_wakeup) ||
+#endif
+                       (auto_stop && !device_may_wakeup(&rhdev->dev)))
                uhci->working_RD = int_enable = 0;
 
        outw(int_enable, uhci->io_addr + USBINTR);
@@ -308,8 +302,7 @@ __acquires(uhci->lock)
                        return;
        }
        if (!(inw(uhci->io_addr + USBSTS) & USBSTS_HCH))
-               dev_warn(&uhci_to_hcd(uhci)->self.root_hub->dev,
-                       "Controller not stopped yet!\n");
+               dev_warn(uhci_dev(uhci), "Controller not stopped yet!\n");
 
        uhci_get_current_frame_number(uhci);
 
@@ -342,7 +335,7 @@ __releases(uhci->lock)
 __acquires(uhci->lock)
 {
        dev_dbg(&uhci_to_hcd(uhci)->self.root_hub->dev,
-                       "%s%s\n", __FUNCTION__,
+                       "%s%s\n", __func__,
                        uhci->rh_state == UHCI_RH_AUTO_STOPPED ?
                                " (auto-start)" : "");
 
@@ -742,7 +735,7 @@ static int uhci_pci_suspend(struct usb_hcd *hcd, pm_message_t message)
        struct uhci_hcd *uhci = hcd_to_uhci(hcd);
        int rc = 0;
 
-       dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
+       dev_dbg(uhci_dev(uhci), "%s\n", __func__);
 
        spin_lock_irq(&uhci->lock);
        if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags) || uhci->dead)
@@ -778,7 +771,7 @@ static int uhci_pci_resume(struct usb_hcd *hcd)
 {
        struct uhci_hcd *uhci = hcd_to_uhci(hcd);
 
-       dev_dbg(uhci_dev(uhci), "%s\n", __FUNCTION__);
+       dev_dbg(uhci_dev(uhci), "%s\n", __func__);
 
        /* Since we aren't in D3 any more, it's safe to set this flag
         * even if the controller was dead.