Skip to content

Commit

Permalink
USB: fix autosuspend bug in usb-serial
Browse files Browse the repository at this point in the history
This patch (as1437) fixes a bug in the usb-serial autosuspend
handling.  Since the usb-serial core now has autosuspend support, it
must set the .supports_autosuspend member in every serial driver it
registers.  Otherwise the usb_autopm_get_interface() call won't work.

This fixes Bugzilla #23012.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
CC: stable@kernel.org
Reported-by: Kevin Smith <thirdwiggin@gmail.com>
Reported-and-tested-by: Simon Gerber <gesimu@gmail.com>
Reported-and-tested-by: Matteo Croce <matteo@openwrt.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Nov 30, 2010
1 parent a85b4e7 commit abf0318
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit abf0318

Please sign in to comment.