diff options
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r-- | drivers/usb/core/hub.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 0f299b7aad60..19d3435e6140 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1465,6 +1465,7 @@ void usb_set_device_state(struct usb_device *udev, | |||
1465 | enum usb_device_state new_state) | 1465 | enum usb_device_state new_state) |
1466 | { | 1466 | { |
1467 | unsigned long flags; | 1467 | unsigned long flags; |
1468 | int wakeup = -1; | ||
1468 | 1469 | ||
1469 | spin_lock_irqsave(&device_state_lock, flags); | 1470 | spin_lock_irqsave(&device_state_lock, flags); |
1470 | if (udev->state == USB_STATE_NOTATTACHED) | 1471 | if (udev->state == USB_STATE_NOTATTACHED) |
@@ -1479,11 +1480,10 @@ void usb_set_device_state(struct usb_device *udev, | |||
1479 | || new_state == USB_STATE_SUSPENDED) | 1480 | || new_state == USB_STATE_SUSPENDED) |
1480 | ; /* No change to wakeup settings */ | 1481 | ; /* No change to wakeup settings */ |
1481 | else if (new_state == USB_STATE_CONFIGURED) | 1482 | else if (new_state == USB_STATE_CONFIGURED) |
1482 | device_set_wakeup_capable(&udev->dev, | 1483 | wakeup = udev->actconfig->desc.bmAttributes |
1483 | (udev->actconfig->desc.bmAttributes | 1484 | & USB_CONFIG_ATT_WAKEUP; |
1484 | & USB_CONFIG_ATT_WAKEUP)); | ||
1485 | else | 1485 | else |
1486 | device_set_wakeup_capable(&udev->dev, 0); | 1486 | wakeup = 0; |
1487 | } | 1487 | } |
1488 | if (udev->state == USB_STATE_SUSPENDED && | 1488 | if (udev->state == USB_STATE_SUSPENDED && |
1489 | new_state != USB_STATE_SUSPENDED) | 1489 | new_state != USB_STATE_SUSPENDED) |
@@ -1495,6 +1495,8 @@ void usb_set_device_state(struct usb_device *udev, | |||
1495 | } else | 1495 | } else |
1496 | recursively_mark_NOTATTACHED(udev); | 1496 | recursively_mark_NOTATTACHED(udev); |
1497 | spin_unlock_irqrestore(&device_state_lock, flags); | 1497 | spin_unlock_irqrestore(&device_state_lock, flags); |
1498 | if (wakeup >= 0) | ||
1499 | device_set_wakeup_capable(&udev->dev, wakeup); | ||
1498 | } | 1500 | } |
1499 | EXPORT_SYMBOL_GPL(usb_set_device_state); | 1501 | EXPORT_SYMBOL_GPL(usb_set_device_state); |
1500 | 1502 | ||