From: Alan Cox Date: Mon, 30 Nov 2009 13:16:57 +0000 (+0000) Subject: tty: tty_port: Move the IO_ERROR clear X-Git-Tag: v2.6.33-rc1~310^2~20 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a9a37ec33a1b3e66b260ac1c29bff0aec8b89ae4;p=karo-tx-linux.git 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 Signed-off-by: Greg Kroah-Hartman --- 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, mutex_lock(&port->mutex); if (!test_bit(ASYNCB_INITIALIZED, &port->flags)) { + clear_bit(TTY_IO_ERROR, &tty->flags); if (port->ops->activate) { int retval = port->ops->activate(port, tty); if (retval) { @@ -417,7 +418,6 @@ 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);