USB: pl2303: use generic close
authorJohan Hovold <jhovold@gmail.com>
Wed, 17 Mar 2010 22:06:04 +0000 (23:06 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 May 2010 20:21:34 +0000 (13:21 -0700)
Use usb_serial_generic_close to kill the read and write urbs and to
reset the write fifo.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/pl2303.c

index 28037c1af93ec01203389d63fafafd402ff28984..18d1c44faa512a29da95d105403fe356800d0aba 100644 (file)
@@ -456,21 +456,10 @@ static void pl2303_dtr_rts(struct usb_serial_port *port, int on)
 
 static void pl2303_close(struct usb_serial_port *port)
 {
-       unsigned long flags;
-
        dbg("%s - port %d", __func__, port->number);
 
-       spin_lock_irqsave(&port->lock, flags);
-       /* clear out any remaining data in the buffer */
-       kfifo_reset_out(&port->write_fifo);
-       spin_unlock_irqrestore(&port->lock, flags);
-
-       /* shutdown our urbs */
-       dbg("%s - shutting down urbs", __func__);
-       usb_kill_urb(port->write_urb);
-       usb_kill_urb(port->read_urb);
+       usb_serial_generic_close(port);
        usb_kill_urb(port->interrupt_in_urb);
-
 }
 
 static int pl2303_open(struct tty_struct *tty, struct usb_serial_port *port)