USB: fix autosuspend bug in usb-serial
[firefly-linux-kernel-4.4.55.git] / drivers / usb / serial / usb-serial.c
index 861223f2af6eddc0a3fb3c4a449b71af9221eed4..6954de50c0ffe5e22cc85ad909af0ceef1dde4fd 100644 (file)
@@ -51,6 +51,7 @@ static struct usb_driver usb_serial_driver = {
        .suspend =      usb_serial_suspend,
        .resume =       usb_serial_resume,
        .no_dynamic_id =        1,
+       .supports_autosuspend = 1,
 };
 
 /* There is no MODULE_DEVICE_TABLE for usbserial.c.  Instead
@@ -1343,6 +1344,8 @@ int usb_serial_register(struct usb_serial_driver *driver)
                return -ENODEV;
 
        fixup_generic(driver);
+       if (driver->usb_driver)
+               driver->usb_driver->supports_autosuspend = 1;
 
        if (!driver->description)
                driver->description = driver->driver.name;