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,24 +104,20 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_open); ...@@ -104,24 +104,20 @@ 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) { if (port->bulk_out_size) {
/* shutdown any bulk transfers that might be going on */ for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i)
if (port->bulk_out_size) { usb_kill_urb(port->write_urbs[i]);
for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i)
usb_kill_urb(port->write_urbs[i]);
spin_lock_irqsave(&port->lock, flags); spin_lock_irqsave(&port->lock, flags);
kfifo_reset_out(&port->write_fifo); kfifo_reset_out(&port->write_fifo);
spin_unlock_irqrestore(&port->lock, flags); spin_unlock_irqrestore(&port->lock, flags);
} }
if (port->bulk_in_size) { if (port->bulk_in_size) {
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]);
}
} }
} }
......
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