aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/serial.c
diff options
context:
space:
mode:
authorSavin Zlobec <savin@epiko.si>2008-02-15 07:42:01 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-25 00:16:35 -0400
commit4208978ec4f0d6001facf95be9defccf1a0bf313 (patch)
tree0ba2aa83a81e365500954708f7f07c459d861dbd /drivers/usb/gadget/serial.c
parentc765d4cad977f7e454a53d5bca5a942156b2d94c (diff)
USB: gadget: Hangup tty on g_serial disconnect
On USB cable disconnect g_serial doesn't hangup the port tty, which results in an endless read on the tty device. With the following patch the read and select behave correctly when the cable is unplugged. Tested on at91rm9200 Signed-off-by: Savin Zlobec <savin@epiko.si> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/serial.c')
-rw-r--r--drivers/usb/gadget/serial.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index f5c3896b1d95..433b3f44f42e 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -2163,8 +2163,7 @@ static void gs_free_ports(struct gs_dev *dev)
2163 port->port_dev = NULL; 2163 port->port_dev = NULL;
2164 wake_up_interruptible(&port->port_write_wait); 2164 wake_up_interruptible(&port->port_write_wait);
2165 if (port->port_tty) { 2165 if (port->port_tty) {
2166 wake_up_interruptible(&port->port_tty->read_wait); 2166 tty_hangup(port->port_tty);
2167 wake_up_interruptible(&port->port_tty->write_wait);
2168 } 2167 }
2169 spin_unlock_irqrestore(&port->port_lock, flags); 2168 spin_unlock_irqrestore(&port->port_lock, flags);
2170 } else { 2169 } else {