diff options
Diffstat (limited to 'drivers/usb/core/hcd.c')
-rw-r--r-- | drivers/usb/core/hcd.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index fc4290b6691c..b07ba051118d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/platform_device.h> | 39 | #include <linux/platform_device.h> |
40 | #include <linux/workqueue.h> | 40 | #include <linux/workqueue.h> |
41 | #include <linux/mutex.h> | 41 | #include <linux/mutex.h> |
42 | #include <linux/pm_runtime.h> | ||
42 | 43 | ||
43 | #include <linux/usb.h> | 44 | #include <linux/usb.h> |
44 | 45 | ||
@@ -1858,6 +1859,10 @@ int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg) | |||
1858 | return status; | 1859 | return status; |
1859 | } | 1860 | } |
1860 | 1861 | ||
1862 | #endif /* CONFIG_PM */ | ||
1863 | |||
1864 | #ifdef CONFIG_USB_SUSPEND | ||
1865 | |||
1861 | /* Workqueue routine for root-hub remote wakeup */ | 1866 | /* Workqueue routine for root-hub remote wakeup */ |
1862 | static void hcd_resume_work(struct work_struct *work) | 1867 | static void hcd_resume_work(struct work_struct *work) |
1863 | { | 1868 | { |
@@ -1884,12 +1889,12 @@ void usb_hcd_resume_root_hub (struct usb_hcd *hcd) | |||
1884 | 1889 | ||
1885 | spin_lock_irqsave (&hcd_root_hub_lock, flags); | 1890 | spin_lock_irqsave (&hcd_root_hub_lock, flags); |
1886 | if (hcd->rh_registered) | 1891 | if (hcd->rh_registered) |
1887 | queue_work(ksuspend_usb_wq, &hcd->wakeup_work); | 1892 | queue_work(pm_wq, &hcd->wakeup_work); |
1888 | spin_unlock_irqrestore (&hcd_root_hub_lock, flags); | 1893 | spin_unlock_irqrestore (&hcd_root_hub_lock, flags); |
1889 | } | 1894 | } |
1890 | EXPORT_SYMBOL_GPL(usb_hcd_resume_root_hub); | 1895 | EXPORT_SYMBOL_GPL(usb_hcd_resume_root_hub); |
1891 | 1896 | ||
1892 | #endif | 1897 | #endif /* CONFIG_USB_SUSPEND */ |
1893 | 1898 | ||
1894 | /*-------------------------------------------------------------------------*/ | 1899 | /*-------------------------------------------------------------------------*/ |
1895 | 1900 | ||
@@ -2034,7 +2039,7 @@ struct usb_hcd *usb_create_hcd (const struct hc_driver *driver, | |||
2034 | init_timer(&hcd->rh_timer); | 2039 | init_timer(&hcd->rh_timer); |
2035 | hcd->rh_timer.function = rh_timer_func; | 2040 | hcd->rh_timer.function = rh_timer_func; |
2036 | hcd->rh_timer.data = (unsigned long) hcd; | 2041 | hcd->rh_timer.data = (unsigned long) hcd; |
2037 | #ifdef CONFIG_PM | 2042 | #ifdef CONFIG_USB_SUSPEND |
2038 | INIT_WORK(&hcd->wakeup_work, hcd_resume_work); | 2043 | INIT_WORK(&hcd->wakeup_work, hcd_resume_work); |
2039 | #endif | 2044 | #endif |
2040 | mutex_init(&hcd->bandwidth_mutex); | 2045 | mutex_init(&hcd->bandwidth_mutex); |
@@ -2234,7 +2239,7 @@ void usb_remove_hcd(struct usb_hcd *hcd) | |||
2234 | hcd->rh_registered = 0; | 2239 | hcd->rh_registered = 0; |
2235 | spin_unlock_irq (&hcd_root_hub_lock); | 2240 | spin_unlock_irq (&hcd_root_hub_lock); |
2236 | 2241 | ||
2237 | #ifdef CONFIG_PM | 2242 | #ifdef CONFIG_USB_SUSPEND |
2238 | cancel_work_sync(&hcd->wakeup_work); | 2243 | cancel_work_sync(&hcd->wakeup_work); |
2239 | #endif | 2244 | #endif |
2240 | 2245 | ||