diff options
author | Alan Cox <alan@linux.intel.com> | 2009-11-30 13:16:52 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 15:18:06 -0800 |
commit | d74e8286885ac9f3ccc5e2dc2301f21bbec90f7b (patch) | |
tree | 398e4c5059dfa752746ca25ce8c21630c55a0a1a /drivers | |
parent | 8f1e672344c39465b58cf3ffcf348afb2539ced9 (diff) | |
download | op-kernel-dev-d74e8286885ac9f3ccc5e2dc2301f21bbec90f7b.zip op-kernel-dev-d74e8286885ac9f3ccc5e2dc2301f21bbec90f7b.tar.gz |
tty: tty_port: Add IO_ERROR bit handling
To propogate tty_port_open/close to a few other devices we need to start
handling the IO_ERROR flag on the tty. We can do this pretty trivially.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tty_port.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c index 3ef644a..43a1907 100644 --- a/drivers/char/tty_port.c +++ b/drivers/char/tty_port.c @@ -122,8 +122,10 @@ void tty_port_hangup(struct tty_port *port) spin_lock_irqsave(&port->lock, flags); port->count = 0; port->flags &= ~ASYNC_NORMAL_ACTIVE; - if (port->tty) + if (port->tty) { + set_bit(TTY_IO_ERROR, &port->tty->flags); tty_kref_put(port->tty); + } port->tty = NULL; spin_unlock_irqrestore(&port->lock, flags); wake_up_interruptible(&port->open_wait); @@ -383,6 +385,7 @@ void tty_port_close(struct tty_port *port, struct tty_struct *tty, if (tty_port_close_start(port, tty, filp) == 0) return; tty_port_shutdown(port); + set_bit(TTY_IO_ERROR, &tty->flags); tty_port_close_end(port, tty); tty_port_tty_set(port, NULL); } @@ -414,6 +417,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty, } } set_bit(ASYNCB_INITIALIZED, &port->flags); + clear_bit(TTY_IO_ERROR, &tty->flags); } mutex_unlock(&port->mutex); return tty_port_block_til_ready(port, tty, filp); |