aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mxser_new.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2006-12-08 05:38:25 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:54 -0500
commit214efebba86260a0fb3ef84b9f5707b58cbc227b (patch)
tree3ae0002bdf2bab8295e79ef4fe9def858f1e4f1b /drivers/char/mxser_new.c
parent7e8bcf9add02176be7e052b1f0675f7a462eaf3d (diff)
[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: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/mxser_new.c')
-rw-r--r--drivers/char/mxser_new.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 71381f955567..c87bda388892 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -461,7 +461,8 @@ static int mxser_block_til_ready(struct tty_struct *tty, struct file *filp,
461 * If non-blocking mode is set, or the port is not enabled, 461 * If non-blocking mode is set, or the port is not enabled,
462 * then make the check up front and then exit. 462 * then make the check up front and then exit.
463 */ 463 */
464 if ((filp->f_flags & O_NONBLOCK) || (tty->flags & (1 << TTY_IO_ERROR))) { 464 if ((filp->f_flags & O_NONBLOCK) ||
465 test_bit(TTY_IO_ERROR, &tty->flags)) {
465 port->flags |= ASYNC_NORMAL_ACTIVE; 466 port->flags |= ASYNC_NORMAL_ACTIVE;
466 return 0; 467 return 0;
467 } 468 }
@@ -1437,7 +1438,7 @@ static int mxser_tiocmget(struct tty_struct *tty, struct file *file)
1437 1438
1438 if (tty->index == MXSER_PORTS) 1439 if (tty->index == MXSER_PORTS)
1439 return -ENOIOCTLCMD; 1440 return -ENOIOCTLCMD;
1440 if (tty->flags & (1 << TTY_IO_ERROR)) 1441 if (test_bit(TTY_IO_ERROR, &tty->flags))
1441 return -EIO; 1442 return -EIO;
1442 1443
1443 control = info->MCR; 1444 control = info->MCR;
@@ -1464,7 +1465,7 @@ static int mxser_tiocmset(struct tty_struct *tty, struct file *file,
1464 1465
1465 if (tty->index == MXSER_PORTS) 1466 if (tty->index == MXSER_PORTS)
1466 return -ENOIOCTLCMD; 1467 return -ENOIOCTLCMD;
1467 if (tty->flags & (1 << TTY_IO_ERROR)) 1468 if (test_bit(TTY_IO_ERROR, &tty->flags))
1468 return -EIO; 1469 return -EIO;
1469 1470
1470 spin_lock_irqsave(&info->slock, flags); 1471 spin_lock_irqsave(&info->slock, flags);
@@ -1798,10 +1799,10 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
1798 } 1799 }
1799 /* above add by Victor Yu. 01-05-2004 */ 1800 /* above add by Victor Yu. 01-05-2004 */
1800 1801
1801 if ((cmd != TIOCGSERIAL) && (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { 1802 if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && cmd != TIOCGICOUNT &&
1802 if (tty->flags & (1 << TTY_IO_ERROR)) 1803 test_bit(TTY_IO_ERROR, &tty->flags))
1803 return -EIO; 1804 return -EIO;
1804 } 1805
1805 switch (cmd) { 1806 switch (cmd) {
1806 case TCSBRK: /* SVID version: non-zero arg --> no break */ 1807 case TCSBRK: /* SVID version: non-zero arg --> no break */
1807 retval = tty_check_change(tty); 1808 retval = tty_check_change(tty);