Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[sfrench/cifs-2.6.git] / drivers / usb / core / urb.c
index b32898e0a27d1da41c256f346347275d495b268e..081796726b951bf449b8b827b970cf7eec1b8571 100644 (file)
@@ -4,12 +4,6 @@
 #include <linux/bitops.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-
-#ifdef CONFIG_USB_DEBUG
-       #define DEBUG
-#else
-       #undef DEBUG
-#endif
 #include <linux/usb.h>
 #include "hcd.h"
 
@@ -237,7 +231,8 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
            (dev->state < USB_STATE_DEFAULT) ||
            (!dev->bus) || (dev->devnum <= 0))
                return -ENODEV;
-       if (dev->state == USB_STATE_SUSPENDED)
+       if (dev->bus->controller->power.power_state.event != PM_EVENT_ON
+                       || dev->state == USB_STATE_SUSPENDED)
                return -EHOSTUNREACH;
        if (!(op = dev->bus->op) || !op->submit_urb)
                return -ENODEV;