aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/hub.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 12:24:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-16 12:24:44 -0400
commitfc82e1d59a24cbac01c49d4eb3b28d6abc26a5f4 (patch)
tree5e01479d69e69dbbe483044b39afd2aa99d4f2b2 /drivers/usb/core/hub.c
parent48d5f6731837f0ec9a0e19ca763aa17d58385a98 (diff)
parentbea3864fb627d110933cfb8babe048b63c4fc76e (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: (21 commits) PM / Hibernate: Reduce autotuned default image size PM / Core: Introduce struct syscore_ops for core subsystems PM PM QoS: Make pm_qos settings readable PM / OPP: opp_find_freq_exact() documentation fix PM: Documentation/power/states.txt: fix repetition PM: Make system-wide PM and runtime PM treat subsystems consistently PM: Simplify kernel/power/Kconfig PM: Add support for device power domains PM: Drop pm_flags that is not necessary PM: Allow pm_runtime_suspend() to succeed during system suspend PM: Clean up PM_TRACE dependencies and drop unnecessary Kconfig option PM: Remove CONFIG_PM_OPS PM: Reorder power management Kconfig options PM: Make CONFIG_PM depend on (CONFIG_PM_SLEEP || CONFIG_PM_RUNTIME) PM / ACPI: Remove references to pm_flags from bus.c PM: Do not create wakeup sysfs files for devices that cannot wake up USB / Hub: Do not call device_set_wakeup_capable() under spinlock PM: Use appropriate printk() priority level in trace.c PM / Wakeup: Don't update events_check_enabled in pm_get_wakeup_count() PM / Wakeup: Make pm_save_wakeup_count() work as documented ...
Diffstat (limited to 'drivers/usb/core/hub.c')
-rw-r--r--drivers/usb/core/hub.c10
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}
1499EXPORT_SYMBOL_GPL(usb_set_device_state); 1501EXPORT_SYMBOL_GPL(usb_set_device_state);
1500 1502