diff options
Diffstat (limited to 'drivers/usb/host/uhci-hcd.c')
-rw-r--r-- | drivers/usb/host/uhci-hcd.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index cf5e4cf7ea42..274751b4409c 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c | |||
@@ -769,7 +769,7 @@ static int uhci_rh_resume(struct usb_hcd *hcd) | |||
769 | return rc; | 769 | return rc; |
770 | } | 770 | } |
771 | 771 | ||
772 | static int uhci_pci_suspend(struct usb_hcd *hcd, pm_message_t message) | 772 | static int uhci_pci_suspend(struct usb_hcd *hcd) |
773 | { | 773 | { |
774 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); | 774 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); |
775 | int rc = 0; | 775 | int rc = 0; |
@@ -795,10 +795,6 @@ static int uhci_pci_suspend(struct usb_hcd *hcd, pm_message_t message) | |||
795 | 795 | ||
796 | /* FIXME: Enable non-PME# remote wakeup? */ | 796 | /* FIXME: Enable non-PME# remote wakeup? */ |
797 | 797 | ||
798 | /* make sure snapshot being resumed re-enumerates everything */ | ||
799 | if (message.event == PM_EVENT_PRETHAW) | ||
800 | uhci_hc_died(uhci); | ||
801 | |||
802 | done_okay: | 798 | done_okay: |
803 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 799 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
804 | done: | 800 | done: |
@@ -806,7 +802,7 @@ done: | |||
806 | return rc; | 802 | return rc; |
807 | } | 803 | } |
808 | 804 | ||
809 | static int uhci_pci_resume(struct usb_hcd *hcd) | 805 | static int uhci_pci_resume(struct usb_hcd *hcd, bool hibernated) |
810 | { | 806 | { |
811 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); | 807 | struct uhci_hcd *uhci = hcd_to_uhci(hcd); |
812 | 808 | ||
@@ -820,6 +816,10 @@ static int uhci_pci_resume(struct usb_hcd *hcd) | |||
820 | 816 | ||
821 | spin_lock_irq(&uhci->lock); | 817 | spin_lock_irq(&uhci->lock); |
822 | 818 | ||
819 | /* Make sure resume from hibernation re-enumerates everything */ | ||
820 | if (hibernated) | ||
821 | uhci_hc_died(uhci); | ||
822 | |||
823 | /* FIXME: Disable non-PME# remote wakeup? */ | 823 | /* FIXME: Disable non-PME# remote wakeup? */ |
824 | 824 | ||
825 | /* The firmware or a boot kernel may have changed the controller | 825 | /* The firmware or a boot kernel may have changed the controller |
@@ -940,10 +940,11 @@ static struct pci_driver uhci_pci_driver = { | |||
940 | .remove = usb_hcd_pci_remove, | 940 | .remove = usb_hcd_pci_remove, |
941 | .shutdown = uhci_shutdown, | 941 | .shutdown = uhci_shutdown, |
942 | 942 | ||
943 | #ifdef CONFIG_PM | 943 | #ifdef CONFIG_PM_SLEEP |
944 | .suspend = usb_hcd_pci_suspend, | 944 | .driver = { |
945 | .resume = usb_hcd_pci_resume, | 945 | .pm = &usb_hcd_pci_pm_ops |
946 | #endif /* PM */ | 946 | }, |
947 | #endif | ||
947 | }; | 948 | }; |
948 | 949 | ||
949 | static int __init uhci_hcd_init(void) | 950 | static int __init uhci_hcd_init(void) |
@@ -961,7 +962,7 @@ static int __init uhci_hcd_init(void) | |||
961 | errbuf = kmalloc(ERRBUF_LEN, GFP_KERNEL); | 962 | errbuf = kmalloc(ERRBUF_LEN, GFP_KERNEL); |
962 | if (!errbuf) | 963 | if (!errbuf) |
963 | goto errbuf_failed; | 964 | goto errbuf_failed; |
964 | uhci_debugfs_root = debugfs_create_dir("uhci", NULL); | 965 | uhci_debugfs_root = debugfs_create_dir("uhci", usb_debug_root); |
965 | if (!uhci_debugfs_root) | 966 | if (!uhci_debugfs_root) |
966 | goto debug_failed; | 967 | goto debug_failed; |
967 | } | 968 | } |