diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-03-21 07:36:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-03-25 16:44:18 -0400 |
commit | 19c61853831f4f957885665ce36a573cbabf9ba1 (patch) | |
tree | 72e695df1f2b6030a2f3374baeb0344cb932e256 /drivers/usb/serial/generic.c | |
parent | e6d144bc27da921b81d46eb7cac461be59ae301b (diff) |
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: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r-- | drivers/usb/serial/generic.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 927c5d6a255e..131d6cbeefee 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -104,24 +104,20 @@ EXPORT_SYMBOL_GPL(usb_serial_generic_open); | |||
104 | 104 | ||
105 | static void generic_cleanup(struct usb_serial_port *port) | 105 | static void generic_cleanup(struct usb_serial_port *port) |
106 | { | 106 | { |
107 | struct usb_serial *serial = port->serial; | ||
108 | unsigned long flags; | 107 | unsigned long flags; |
109 | int i; | 108 | int i; |
110 | 109 | ||
111 | if (serial->dev) { | 110 | if (port->bulk_out_size) { |
112 | /* shutdown any bulk transfers that might be going on */ | 111 | for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) |
113 | if (port->bulk_out_size) { | 112 | usb_kill_urb(port->write_urbs[i]); |
114 | for (i = 0; i < ARRAY_SIZE(port->write_urbs); ++i) | ||
115 | usb_kill_urb(port->write_urbs[i]); | ||
116 | 113 | ||
117 | spin_lock_irqsave(&port->lock, flags); | 114 | spin_lock_irqsave(&port->lock, flags); |
118 | kfifo_reset_out(&port->write_fifo); | 115 | kfifo_reset_out(&port->write_fifo); |
119 | spin_unlock_irqrestore(&port->lock, flags); | 116 | spin_unlock_irqrestore(&port->lock, flags); |
120 | } | 117 | } |
121 | if (port->bulk_in_size) { | 118 | if (port->bulk_in_size) { |
122 | for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) | 119 | for (i = 0; i < ARRAY_SIZE(port->read_urbs); ++i) |
123 | usb_kill_urb(port->read_urbs[i]); | 120 | usb_kill_urb(port->read_urbs[i]); |
124 | } | ||
125 | } | 121 | } |
126 | } | 122 | } |
127 | 123 | ||