From faa1e5b5231f39667de693de8ff9257b88ff9692 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Wed, 9 Nov 2011 21:33:46 +0100 Subject: [PATCH] --- yaml --- r: 280671 b: refs/heads/master c: d30ccf08e8e01060288587f52a78c3ca0fcfc1fc h: refs/heads/master i: 280669: e7923ce38f5e107eb23719ba3a5356f0ddc92c91 280667: ca2ef891639284780e11f4176a894054b0f7b2f6 280663: abe5fe23b333a451c83e344b8eb61b079055cba8 280655: 931dbae91ae36ac4e8bcaee77309bbac568b690e 280639: 0a6bd31697c1467fee79c377b3ddabc5369f494b v: v3 --- [refs] | 2 +- trunk/drivers/tty/serial/serial_core.c | 40 +------------------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/[refs] b/[refs] index 5aa8d19ac32c..0699926f335c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4cb0fbfdc81f29a414583bd05a9e324f8f19984d +refs/heads/master: d30ccf08e8e01060288587f52a78c3ca0fcfc1fc diff --git a/trunk/drivers/tty/serial/serial_core.c b/trunk/drivers/tty/serial/serial_core.c index 2b1ee7cc4f8a..fcb534250c85 100644 --- a/trunk/drivers/tty/serial/serial_core.c +++ b/trunk/drivers/tty/serial/serial_core.c @@ -1267,46 +1267,8 @@ static void uart_close(struct tty_struct *tty, struct file *filp) pr_debug("uart_close(%d) called\n", uport->line); - spin_lock_irqsave(&port->lock, flags); - - if (tty_hung_up_p(filp)) { - spin_unlock_irqrestore(&port->lock, flags); + if (tty_port_close_start(port, tty, filp) == 0) return; - } - - if ((tty->count == 1) && (port->count != 1)) { - /* - * Uh, oh. tty->count is 1, which means that the tty - * structure will be freed. port->count should always - * be one in these conditions. If it's greater than - * one, we've got real problems, since it means the - * serial port won't be shutdown. - */ - printk(KERN_ERR "uart_close: bad serial port count; tty->count is 1, " - "port->count is %d\n", port->count); - port->count = 1; - } - if (--port->count < 0) { - printk(KERN_ERR "uart_close: bad serial port count for %s: %d\n", - tty->name, port->count); - port->count = 0; - } - if (port->count) { - spin_unlock_irqrestore(&port->lock, flags); - return; - } - - /* - * Now we wait for the transmit buffer to clear; and we notify - * the line discipline to only process XON/XOFF characters by - * setting tty->closing. - */ - set_bit(ASYNCB_CLOSING, &port->flags); - tty->closing = 1; - spin_unlock_irqrestore(&port->lock, flags); - - if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE) - tty_wait_until_sent_from_close(tty, port->closing_wait); /* * At this point, we stop accepting input. To do this, we