|
@@ -1336,7 +1336,6 @@ static int usb_serial_register(struct usb_serial_driver *driver)
|
|
|
driver->description);
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
- driver->usb_driver->supports_autosuspend = 1;
|
|
|
|
|
|
/* Add this device to our list of devices */
|
|
|
mutex_lock(&table_lock);
|
|
@@ -1371,7 +1370,7 @@ static void usb_serial_deregister(struct usb_serial_driver *device)
|
|
|
* @serial_drivers: NULL-terminated array of pointers to drivers to be registered
|
|
|
*
|
|
|
* Registers @udriver and all the drivers in the @serial_drivers array.
|
|
|
- * Automatically fills in the .no_dynamic_id field in @udriver and
|
|
|
+ * Automatically fills in the .no_dynamic_id and PM fields in @udriver and
|
|
|
* the .usb_driver field in each serial driver.
|
|
|
*/
|
|
|
int usb_serial_register_drivers(struct usb_driver *udriver,
|
|
@@ -1390,11 +1389,17 @@ int usb_serial_register_drivers(struct usb_driver *udriver,
|
|
|
* the serial drivers are registered, because the probe would
|
|
|
* simply fail for lack of a matching serial driver.
|
|
|
* Therefore save off udriver's id_table until we are all set.
|
|
|
+ *
|
|
|
+ * Suspend/resume support is implemented in the usb-serial core,
|
|
|
+ * so fill in the PM-related fields in udriver.
|
|
|
*/
|
|
|
saved_id_table = udriver->id_table;
|
|
|
udriver->id_table = NULL;
|
|
|
|
|
|
udriver->no_dynamic_id = 1;
|
|
|
+ udriver->supports_autosuspend = 1;
|
|
|
+ udriver->suspend = usb_serial_suspend;
|
|
|
+ udriver->resume = usb_serial_resume;
|
|
|
rc = usb_register(udriver);
|
|
|
if (rc)
|
|
|
return rc;
|