Commit 19c61853 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: serial: remove bogus disconnect test in cleanup

Remove bogus (and unnecessary) test for serial->dev being NULL in
cleanup.

The device is never cleared, and cleanup is never called after a
completed disconnect anyway.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e6d144bc
...@@ -104,12 +104,9 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_open); ...@@ -104,12 +104,9 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_open);
static void generic_cleanup(struct usb_serial_port *port) static void generic_cleanup(struct usb_serial_port *port)
{ {
struct usb_serial *serial = port->serial;
unsigned long flags; unsigned long flags;
int i; int i;
if (serial->dev) {
/* shutdown any bulk transfers that might be going on */
if (port->bulk_out_size) { if (port->bulk_out_size) {
for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i)
usb_kill_urb(port->write_urbs[i]); usb_kill_urb(port->write_urbs[i]);
...@@ -122,7 +119,6 @@ static void generic_cleanup(struct usb_serial_port *port) ...@@ -122,7 +119,6 @@ static void generic_cleanup(struct usb_serial_port *port)
for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i)
usb_kill_urb(port->read_urbs[i]); usb_kill_urb(port->read_urbs[i]);
} }
}
} }
void usb_serial_generic_close(struct usb_serial_port *port) void usb_serial_generic_close(struct usb_serial_port *port)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment