diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2004-10-20 01:31:02 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2004-10-20 01:31:02 -0700 |
| commit | b447780d5aeb30b050297a0fa185c2f5bb4d65a4 (patch) | |
| tree | 98bd6c2f477062eef5394029e9a09dcfdfe31887 | |
| parent | cee6102dff8a67f5a91ee44aad16824345497ce0 (diff) | |
USB: remove unneeded checks in the usb-serial core.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
| -rw-r--r-- | drivers/usb/serial/usb-serial.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index e3b7c1dd2f4c..8d087a588b6e 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -452,18 +452,12 @@ static void destroy_serial(struct kref *kref) port = serial->port[i]; if (!port) continue; - if (port->read_urb) { - usb_kill_urb(port->read_urb); - usb_free_urb(port->read_urb); - } - if (port->write_urb) { - usb_kill_urb(port->write_urb); - usb_free_urb(port->write_urb); - } - if (port->interrupt_in_urb) { - usb_kill_urb(port->interrupt_in_urb); - usb_free_urb(port->interrupt_in_urb); - } + usb_kill_urb(port->read_urb); + usb_free_urb(port->read_urb); + usb_kill_urb(port->write_urb); + usb_free_urb(port->write_urb); + usb_kill_urb(port->interrupt_in_urb); + usb_free_urb(port->interrupt_in_urb); kfree(port->bulk_in_buffer); kfree(port->bulk_out_buffer); kfree(port->interrupt_in_buffer); @@ -799,18 +793,12 @@ static void port_release(struct device *dev) struct usb_serial_port *port = to_usb_serial_port(dev); dbg ("%s - %s", __FUNCTION__, dev->bus_id); - if (port->read_urb) { - usb_kill_urb(port->read_urb); - usb_free_urb(port->read_urb); - } - if (port->write_urb) { - usb_kill_urb(port->write_urb); - usb_free_urb(port->write_urb); - } - if (port->interrupt_in_urb) { - usb_kill_urb(port->interrupt_in_urb); - usb_free_urb(port->interrupt_in_urb); - } + usb_kill_urb(port->read_urb); + usb_free_urb(port->read_urb); + usb_kill_urb(port->write_urb); + usb_free_urb(port->write_urb); + usb_kill_urb(port->interrupt_in_urb); + usb_free_urb(port->interrupt_in_urb); kfree(port->bulk_in_buffer); kfree(port->bulk_out_buffer); kfree(port->interrupt_in_buffer); |
