diff options
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r-- | drivers/usb/core/driver.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index c2aad6a4d49f..ee18d187ca17 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
26 | #include <linux/usb.h> | 26 | #include <linux/usb.h> |
27 | #include <linux/workqueue.h> | ||
27 | #include "hcd.h" | 28 | #include "hcd.h" |
28 | #include "usb.h" | 29 | #include "usb.h" |
29 | 30 | ||
@@ -1131,7 +1132,7 @@ void usb_autosuspend_device(struct usb_device *udev, int dec_usage_cnt) | |||
1131 | mutex_lock_nested(&udev->pm_mutex, udev->level); | 1132 | mutex_lock_nested(&udev->pm_mutex, udev->level); |
1132 | udev->pm_usage_cnt -= dec_usage_cnt; | 1133 | udev->pm_usage_cnt -= dec_usage_cnt; |
1133 | if (udev->pm_usage_cnt <= 0) | 1134 | if (udev->pm_usage_cnt <= 0) |
1134 | schedule_delayed_work(&udev->autosuspend, | 1135 | queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend, |
1135 | USB_AUTOSUSPEND_DELAY); | 1136 | USB_AUTOSUSPEND_DELAY); |
1136 | mutex_unlock(&udev->pm_mutex); | 1137 | mutex_unlock(&udev->pm_mutex); |
1137 | // dev_dbg(&udev->dev, "%s: cnt %d\n", | 1138 | // dev_dbg(&udev->dev, "%s: cnt %d\n", |
@@ -1215,10 +1216,10 @@ void usb_autopm_put_interface(struct usb_interface *intf) | |||
1215 | struct usb_device *udev = interface_to_usbdev(intf); | 1216 | struct usb_device *udev = interface_to_usbdev(intf); |
1216 | 1217 | ||
1217 | mutex_lock_nested(&udev->pm_mutex, udev->level); | 1218 | mutex_lock_nested(&udev->pm_mutex, udev->level); |
1218 | if (intf->condition != USB_INTERFACE_UNBOUND) { | 1219 | if (intf->condition != USB_INTERFACE_UNBOUND && |
1219 | if (--intf->pm_usage_cnt <= 0) | 1220 | --intf->pm_usage_cnt <= 0) { |
1220 | schedule_delayed_work(&udev->autosuspend, | 1221 | queue_delayed_work(ksuspend_usb_wq, &udev->autosuspend, |
1221 | USB_AUTOSUSPEND_DELAY); | 1222 | USB_AUTOSUSPEND_DELAY); |
1222 | } | 1223 | } |
1223 | mutex_unlock(&udev->pm_mutex); | 1224 | mutex_unlock(&udev->pm_mutex); |
1224 | // dev_dbg(&intf->dev, "%s: cnt %d\n", | 1225 | // dev_dbg(&intf->dev, "%s: cnt %d\n", |