Commit 214efebb authored by Jiri Slaby's avatar Jiri Slaby Committed by Linus Torvalds

[PATCH] Char: mxser_new, testbit for bit testing

Use testbit like in tty subsystem for TTY_IO_ERROR testing.

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7e8bcf9a
...@@ -461,7 +461,8 @@ static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp, ...@@ -461,7 +461,8 @@ static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp,
* If non-blocking mode is set, or the port is not enabled, * If non-blocking mode is set, or the port is not enabled,
* then make the check up front and then exit. * then make the check up front and then exit.
*/ */
if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { if ((filp->f_flags & O_NONBLOCK) ||
test_bit(TTY_IO_ERROR, &tty->flags)) {
port->flags |= ASYNC_NORMAL_ACTIVE; port->flags |= ASYNC_NORMAL_ACTIVE;
return 0; return 0;
} }
...@@ -1437,7 +1438,7 @@ static int mxser_tiocmget(struct tty_struct *tty, struct file *file) ...@@ -1437,7 +1438,7 @@ static int mxser_tiocmget(struct tty_struct *tty, struct file *file)
if (tty->index == MXSER_PORTS) if (tty->index == MXSER_PORTS)
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
if (tty->flags & (1 << TTY_IO_ERROR)) if (test_bit(TTY_IO_ERROR, &tty->flags))
return -EIO; return -EIO;
control = info->MCR; control = info->MCR;
...@@ -1464,7 +1465,7 @@ static int mxser_tiocmset(struct tty_struct *tty, struct file *file, ...@@ -1464,7 +1465,7 @@ static int mxser_tiocmset(struct tty_struct *tty, struct file *file,
if (tty->index == MXSER_PORTS) if (tty->index == MXSER_PORTS)
return -ENOIOCTLCMD; return -ENOIOCTLCMD;
if (tty->flags & (1 << TTY_IO_ERROR)) if (test_bit(TTY_IO_ERROR, &tty->flags))
return -EIO; return -EIO;
spin_lock_irqsave(&info->slock, flags); spin_lock_irqsave(&info->slock, flags);
...@@ -1798,10 +1799,10 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file, ...@@ -1798,10 +1799,10 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
} }
/* above add by Victor Yu. 01-05-2004 */ /* above add by Victor Yu. 01-05-2004 */
if ((cmd != TIOCGSERIAL) && (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && cmd != TIOCGICOUNT &&
if (tty->flags & (1 << TTY_IO_ERROR)) test_bit(TTY_IO_ERROR, &tty->flags))
return -EIO; return -EIO;
}
switch (cmd) { switch (cmd) {
case TCSBRK: /* SVID version: non-zero arg --> no break */ case TCSBRK: /* SVID version: non-zero arg --> no break */
retval = tty_check_change(tty); retval = tty_check_change(tty);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment