Skip to content

Commit

Permalink
USB: pl2303: use generic close
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed May 20, 2010
1 parent 684c6e3 commit 8b0127b
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8b0127b

Please sign in to comment.