diff options
author | Johan Hovold <jhovold@gmail.com> | 2013-06-26 16:47:22 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 16:21:50 -0700 |
commit | f5f45304512fa167883dbf7cc23ff92008b173e7 (patch) | |
tree | 6c9f0220776d0686c3ae882d0cf85bc8776dfd40 /drivers/usb/serial/usb-serial.c | |
parent | 91c4211c394996df485184b7308c8868be1b2055 (diff) |
USB: serial: clean up dtr_rts
Since commit 957dacae ("TTY: fix DTR not being dropped on hang up")
dtr_rts is no longer called for uninitialised ports (e.g. after
a disconnect), which removes the need to grab the disconnect mutex.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index cb27fcb2fc9..6091bd5a1f4 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -681,20 +681,10 @@ static int serial_port_carrier_raised(struct tty_port *port) static void serial_port_dtr_rts(struct tty_port *port, int on) { struct usb_serial_port *p = container_of(port, struct usb_serial_port, port); - struct usb_serial *serial = p->serial; - struct usb_serial_driver *drv = serial->type; + struct usb_serial_driver *drv = p->serial->type; - if (!drv->dtr_rts) - return; - /* - * Work-around bug in the tty-layer which can result in dtr_rts - * being called after a disconnect (and tty_unregister_device - * has returned). Remove once bug has been squashed. - */ - mutex_lock(&serial->disc_mutex); - if (!serial->disconnected) + if (drv->dtr_rts) drv->dtr_rts(p, on); - mutex_unlock(&serial->disc_mutex); } static const struct tty_port_operations serial_port_ops = { |