aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_port.c
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-11-30 08:16:57 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 18:18:06 -0500
commita9a37ec33a1b3e66b260ac1c29bff0aec8b89ae4 (patch)
tree91b83c156abea75c5384556b8b7bc24edb1bc169 /drivers/char/tty_port.c
parentd74e8286885ac9f3ccc5e2dc2301f21bbec90f7b (diff)
tty: tty_port: Move the IO_ERROR clear
Some devices want to set IO_ERROR in their activate methods so that you can be handed a 'dead' port for operations like setserial. Thus we need to clear the flag before activate so that activate can choose to set the flag and still return 0. This is fine as the file handle/tty are not accessible to the user yet. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/tty_port.c')
-rw-r--r--drivers/char/tty_port.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tty_port.c b/drivers/char/tty_port.c
index 43a190738fee..84006de2900f 100644
--- a/drivers/char/tty_port.c
+++ b/drivers/char/tty_port.c
@@ -409,6 +409,7 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
409 mutex_lock(&port->mutex); 409 mutex_lock(&port->mutex);
410 410
411 if (!test_bit(ASYNCB_INITIALIZED, &port->flags)) { 411 if (!test_bit(ASYNCB_INITIALIZED, &port->flags)) {
412 clear_bit(TTY_IO_ERROR, &tty->flags);
412 if (port->ops->activate) { 413 if (port->ops->activate) {
413 int retval = port->ops->activate(port, tty); 414 int retval = port->ops->activate(port, tty);
414 if (retval) { 415 if (retval) {
@@ -417,7 +418,6 @@ int tty_port_open(struct tty_port *port, struct tty_struct *tty,
417 } 418 }
418 } 419 }
419 set_bit(ASYNCB_INITIALIZED, &port->flags); 420 set_bit(ASYNCB_INITIALIZED, &port->flags);
420 clear_bit(TTY_IO_ERROR, &tty->flags);
421 } 421 }
422 mutex_unlock(&port->mutex); 422 mutex_unlock(&port->mutex);
423 return tty_port_block_til_ready(port, tty, filp); 423 return tty_port_block_til_ready(port, tty, filp);