summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavin Zlobec <savin@epiko.si>2008-02-15 13:42:01 +0100
committerStephen Rothwell <sfr@canb.auug.org.au>2008-02-22 11:51:09 +1100
commit2f323dc805336a8ed27031b0ea4504f0f1f1f4fd (patch)
treeea88c64e5c36799f4f80543c8f962617132d5695
parent83e6a0a10ec9ba5637a12d707c23513714009286 (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>
-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)
port->port_dev = NULL;
wake_up_interruptible(&port->port_write_wait);
if (port->port_tty) {
- wake_up_interruptible(&port->port_tty->read_wait);
- wake_up_interruptible(&port->port_tty->write_wait);
+ tty_hangup(port->port_tty);
}
spin_unlock_irqrestore(&port->port_lock, flags);
} else {