Merge branch 'pm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[pandora-kernel.git] / drivers / usb / core / driver.c
index e030428..3b029a0 100644 (file)
@@ -1582,7 +1582,7 @@ int usb_autopm_get_interface_async(struct usb_interface *intf)
        dev_vdbg(&intf->dev, "%s: cnt %d -> %d\n",
                        __func__, atomic_read(&intf->dev.power.usage_count),
                        status);
-       if (status > 0)
+       if (status > 0 || status == -EINPROGRESS)
                status = 0;
        return status;
 }
@@ -1699,6 +1699,20 @@ int usb_runtime_idle(struct device *dev)
        return 0;
 }
 
+int usb_set_usb2_hardware_lpm(struct usb_device *udev, int enable)
+{
+       struct usb_hcd *hcd = bus_to_hcd(udev->bus);
+       int ret = -EPERM;
+
+       if (hcd->driver->set_usb2_hw_lpm) {
+               ret = hcd->driver->set_usb2_hw_lpm(hcd, udev, enable);
+               if (!ret)
+                       udev->usb2_hw_lpm_enabled = enable;
+       }
+
+       return ret;
+}
+
 #endif /* CONFIG_USB_SUSPEND */
 
 struct bus_type usb_bus_type = {