aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/pcmcia/synclink_cs.c2
-rw-r--r--drivers/isdn/i4l/isdn_tty.c6
-rw-r--r--drivers/s390/char/tty3270.c4
-rw-r--r--drivers/staging/dgnc/dgnc_tty.c2
-rw-r--r--drivers/tty/amiserial.c6
-rw-r--r--drivers/tty/mxser.c7
-rw-r--r--drivers/tty/pty.c2
-rw-r--r--drivers/tty/serial/crisv10.c5
-rw-r--r--drivers/tty/serial/serial_core.c8
-rw-r--r--drivers/tty/synclink.c4
-rw-r--r--drivers/tty/synclink_gt.c4
-rw-r--r--drivers/tty/synclinkmp.c4
-rw-r--r--drivers/tty/tty_io.c5
-rw-r--r--drivers/tty/tty_port.c2
14 files changed, 29 insertions, 32 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 22c27652e46a..825db423b7a8 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -2246,7 +2246,7 @@ static int mgslpc_ioctl(struct tty_struct *tty,
2246 2246
2247 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 2247 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
2248 (cmd != TIOCMIWAIT)) { 2248 (cmd != TIOCMIWAIT)) {
2249 if (tty->flags & (1 << TTY_IO_ERROR)) 2249 if (tty_io_error(tty))
2250 return -EIO; 2250 return -EIO;
2251 } 2251 }
2252 2252
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 947d5c978b8f..f1edc0814120 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1351,7 +1351,7 @@ isdn_tty_tiocmget(struct tty_struct *tty)
1351 1351
1352 if (isdn_tty_paranoia_check(info, tty->name, __func__)) 1352 if (isdn_tty_paranoia_check(info, tty->name, __func__))
1353 return -ENODEV; 1353 return -ENODEV;
1354 if (tty->flags & (1 << TTY_IO_ERROR)) 1354 if (tty_io_error(tty))
1355 return -EIO; 1355 return -EIO;
1356 1356
1357 mutex_lock(&modem_info_mutex); 1357 mutex_lock(&modem_info_mutex);
@@ -1378,7 +1378,7 @@ isdn_tty_tiocmset(struct tty_struct *tty,
1378 1378
1379 if (isdn_tty_paranoia_check(info, tty->name, __func__)) 1379 if (isdn_tty_paranoia_check(info, tty->name, __func__))
1380 return -ENODEV; 1380 return -ENODEV;
1381 if (tty->flags & (1 << TTY_IO_ERROR)) 1381 if (tty_io_error(tty))
1382 return -EIO; 1382 return -EIO;
1383 1383
1384#ifdef ISDN_DEBUG_MODEM_IOCTL 1384#ifdef ISDN_DEBUG_MODEM_IOCTL
@@ -1419,7 +1419,7 @@ isdn_tty_ioctl(struct tty_struct *tty, uint cmd, ulong arg)
1419 1419
1420 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_ioctl")) 1420 if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_ioctl"))
1421 return -ENODEV; 1421 return -ENODEV;
1422 if (tty->flags & (1 << TTY_IO_ERROR)) 1422 if (tty_io_error(tty))
1423 return -EIO; 1423 return -EIO;
1424 switch (cmd) { 1424 switch (cmd) {
1425 case TCSBRK: /* SVID version: non-zero arg --> no break */ 1425 case TCSBRK: /* SVID version: non-zero arg --> no break */
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c
index e96fc7fd9498..080a9872c68f 100644
--- a/drivers/s390/char/tty3270.c
+++ b/drivers/s390/char/tty3270.c
@@ -1804,7 +1804,7 @@ static int tty3270_ioctl(struct tty_struct *tty, unsigned int cmd,
1804 tp = tty->driver_data; 1804 tp = tty->driver_data;
1805 if (!tp) 1805 if (!tp)
1806 return -ENODEV; 1806 return -ENODEV;
1807 if (tty->flags & (1 << TTY_IO_ERROR)) 1807 if (tty_io_error(tty))
1808 return -EIO; 1808 return -EIO;
1809 return kbd_ioctl(tp->kbd, cmd, arg); 1809 return kbd_ioctl(tp->kbd, cmd, arg);
1810} 1810}
@@ -1818,7 +1818,7 @@ static long tty3270_compat_ioctl(struct tty_struct *tty,
1818 tp = tty->driver_data; 1818 tp = tty->driver_data;
1819 if (!tp) 1819 if (!tp)
1820 return -ENODEV; 1820 return -ENODEV;
1821 if (tty->flags & (1 << TTY_IO_ERROR)) 1821 if (tty_io_error(tty))
1822 return -EIO; 1822 return -EIO;
1823 return kbd_ioctl(tp->kbd, cmd, (unsigned long)compat_ptr(arg)); 1823 return kbd_ioctl(tp->kbd, cmd, (unsigned long)compat_ptr(arg));
1824} 1824}
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index bcd2bdfb9c8f..5c221593a0c6 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1255,7 +1255,7 @@ static int dgnc_block_til_ready(struct tty_struct *tty,
1255 if (file->f_flags & O_NONBLOCK) 1255 if (file->f_flags & O_NONBLOCK)
1256 break; 1256 break;
1257 1257
1258 if (tty->flags & (1 << TTY_IO_ERROR)) { 1258 if (tty_io_error(tty)) {
1259 retval = -EIO; 1259 retval = -EIO;
1260 break; 1260 break;
1261 } 1261 }
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index eacf4c9f3b29..183e98e84d09 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -1143,7 +1143,7 @@ static int rs_tiocmget(struct tty_struct *tty)
1143 1143
1144 if (serial_paranoia_check(info, tty->name, "rs_ioctl")) 1144 if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
1145 return -ENODEV; 1145 return -ENODEV;
1146 if (tty->flags & (1 << TTY_IO_ERROR)) 1146 if (tty_io_error(tty))
1147 return -EIO; 1147 return -EIO;
1148 1148
1149 control = info->MCR; 1149 control = info->MCR;
@@ -1165,7 +1165,7 @@ static int rs_tiocmset(struct tty_struct *tty, unsigned int set,
1165 1165
1166 if (serial_paranoia_check(info, tty->name, "rs_ioctl")) 1166 if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
1167 return -ENODEV; 1167 return -ENODEV;
1168 if (tty->flags & (1 << TTY_IO_ERROR)) 1168 if (tty_io_error(tty))
1169 return -EIO; 1169 return -EIO;
1170 1170
1171 local_irq_save(flags); 1171 local_irq_save(flags);
@@ -1250,7 +1250,7 @@ static int rs_ioctl(struct tty_struct *tty,
1250 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 1250 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
1251 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) && 1251 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
1252 (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) { 1252 (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
1253 if (tty->flags & (1 << TTY_IO_ERROR)) 1253 if (tty_io_error(tty))
1254 return -EIO; 1254 return -EIO;
1255 } 1255 }
1256 1256
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 2f12bb9f4336..f23c2a101688 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -1334,7 +1334,7 @@ static int mxser_tiocmget(struct tty_struct *tty)
1334 1334
1335 if (tty->index == MXSER_PORTS) 1335 if (tty->index == MXSER_PORTS)
1336 return -ENOIOCTLCMD; 1336 return -ENOIOCTLCMD;
1337 if (test_bit(TTY_IO_ERROR, &tty->flags)) 1337 if (tty_io_error(tty))
1338 return -EIO; 1338 return -EIO;
1339 1339
1340 control = info->MCR; 1340 control = info->MCR;
@@ -1361,7 +1361,7 @@ static int mxser_tiocmset(struct tty_struct *tty,
1361 1361
1362 if (tty->index == MXSER_PORTS) 1362 if (tty->index == MXSER_PORTS)
1363 return -ENOIOCTLCMD; 1363 return -ENOIOCTLCMD;
1364 if (test_bit(TTY_IO_ERROR, &tty->flags)) 1364 if (tty_io_error(tty))
1365 return -EIO; 1365 return -EIO;
1366 1366
1367 spin_lock_irqsave(&info->slock, flags); 1367 spin_lock_irqsave(&info->slock, flags);
@@ -1715,8 +1715,7 @@ static int mxser_ioctl(struct tty_struct *tty,
1715 return 0; 1715 return 0;
1716 } 1716 }
1717 1717
1718 if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && 1718 if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && tty_io_error(tty))
1719 test_bit(TTY_IO_ERROR, &tty->flags))
1720 return -EIO; 1719 return -EIO;
1721 1720
1722 switch (cmd) { 1721 switch (cmd) {
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 0058d9fbf931..a8a292fd564f 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -44,7 +44,7 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
44 if (tty->driver->subtype == PTY_TYPE_MASTER) 44 if (tty->driver->subtype == PTY_TYPE_MASTER)
45 WARN_ON(tty->count > 1); 45 WARN_ON(tty->count > 1);
46 else { 46 else {
47 if (test_bit(TTY_IO_ERROR, &tty->flags)) 47 if (tty_io_error(tty))
48 return; 48 return;
49 if (tty->count > 2) 49 if (tty->count > 2)
50 return; 50 return;
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index c0172bf54a9b..546990334815 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -3445,7 +3445,7 @@ rs_ioctl(struct tty_struct *tty,
3445 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 3445 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
3446 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) && 3446 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
3447 (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) { 3447 (cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
3448 if (tty->flags & (1 << TTY_IO_ERROR)) 3448 if (tty_io_error(tty))
3449 return -EIO; 3449 return -EIO;
3450 } 3450 }
3451 3451
@@ -3755,8 +3755,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
3755 * If non-blocking mode is set, or the port is not enabled, 3755 * If non-blocking mode is set, or the port is not enabled,
3756 * then make the check up front and then exit. 3756 * then make the check up front and then exit.
3757 */ 3757 */
3758 if ((filp->f_flags & O_NONBLOCK) || 3758 if ((filp->f_flags & O_NONBLOCK) || tty_io_error(tty)) {
3759 (tty->flags & (1 << TTY_IO_ERROR))) {
3760 info->port.flags |= ASYNC_NORMAL_ACTIVE; 3759 info->port.flags |= ASYNC_NORMAL_ACTIVE;
3761 return 0; 3760 return 0;
3762 } 3761 }
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index a126a603b083..67b395031347 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -969,7 +969,7 @@ static int uart_tiocmget(struct tty_struct *tty)
969 int result = -EIO; 969 int result = -EIO;
970 970
971 mutex_lock(&port->mutex); 971 mutex_lock(&port->mutex);
972 if (!(tty->flags & (1 << TTY_IO_ERROR))) { 972 if (!tty_io_error(tty)) {
973 result = uport->mctrl; 973 result = uport->mctrl;
974 spin_lock_irq(&uport->lock); 974 spin_lock_irq(&uport->lock);
975 result |= uport->ops->get_mctrl(uport); 975 result |= uport->ops->get_mctrl(uport);
@@ -989,7 +989,7 @@ uart_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear)
989 int ret = -EIO; 989 int ret = -EIO;
990 990
991 mutex_lock(&port->mutex); 991 mutex_lock(&port->mutex);
992 if (!(tty->flags & (1 << TTY_IO_ERROR))) { 992 if (!tty_io_error(tty)) {
993 uart_update_mctrl(uport, set, clear); 993 uart_update_mctrl(uport, set, clear);
994 ret = 0; 994 ret = 0;
995 } 995 }
@@ -1238,7 +1238,7 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd,
1238 if (ret != -ENOIOCTLCMD) 1238 if (ret != -ENOIOCTLCMD)
1239 goto out; 1239 goto out;
1240 1240
1241 if (tty->flags & (1 << TTY_IO_ERROR)) { 1241 if (tty_io_error(tty)) {
1242 ret = -EIO; 1242 ret = -EIO;
1243 goto out; 1243 goto out;
1244 } 1244 }
@@ -1257,7 +1257,7 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd,
1257 1257
1258 mutex_lock(&port->mutex); 1258 mutex_lock(&port->mutex);
1259 1259
1260 if (tty->flags & (1 << TTY_IO_ERROR)) { 1260 if (tty_io_error(tty)) {
1261 ret = -EIO; 1261 ret = -EIO;
1262 goto out_up; 1262 goto out_up;
1263 } 1263 }
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index f5476e270734..8b2277223ee7 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -2972,7 +2972,7 @@ static int mgsl_ioctl(struct tty_struct *tty,
2972 2972
2973 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 2973 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
2974 (cmd != TIOCMIWAIT)) { 2974 (cmd != TIOCMIWAIT)) {
2975 if (tty->flags & (1 << TTY_IO_ERROR)) 2975 if (tty_io_error(tty))
2976 return -EIO; 2976 return -EIO;
2977 } 2977 }
2978 2978
@@ -3270,7 +3270,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
3270 printk("%s(%d):block_til_ready on %s\n", 3270 printk("%s(%d):block_til_ready on %s\n",
3271 __FILE__,__LINE__, tty->driver->name ); 3271 __FILE__,__LINE__, tty->driver->name );
3272 3272
3273 if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ 3273 if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) {
3274 /* nonblock mode is set or port is not enabled */ 3274 /* nonblock mode is set or port is not enabled */
3275 port->flags |= ASYNC_NORMAL_ACTIVE; 3275 port->flags |= ASYNC_NORMAL_ACTIVE;
3276 return 0; 3276 return 0;
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index c0a2f5a1b1c2..1f7d6d9437e6 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -1032,7 +1032,7 @@ static int ioctl(struct tty_struct *tty,
1032 1032
1033 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 1033 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
1034 (cmd != TIOCMIWAIT)) { 1034 (cmd != TIOCMIWAIT)) {
1035 if (tty->flags & (1 << TTY_IO_ERROR)) 1035 if (tty_io_error(tty))
1036 return -EIO; 1036 return -EIO;
1037 } 1037 }
1038 1038
@@ -3269,7 +3269,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
3269 3269
3270 DBGINFO(("%s block_til_ready\n", tty->driver->name)); 3270 DBGINFO(("%s block_til_ready\n", tty->driver->name));
3271 3271
3272 if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ 3272 if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) {
3273 /* nonblock mode is set or port is not enabled */ 3273 /* nonblock mode is set or port is not enabled */
3274 port->flags |= ASYNC_NORMAL_ACTIVE; 3274 port->flags |= ASYNC_NORMAL_ACTIVE;
3275 return 0; 3275 return 0;
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
index 90da0c712262..e93879944905 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -1261,7 +1261,7 @@ static int ioctl(struct tty_struct *tty,
1261 1261
1262 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 1262 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
1263 (cmd != TIOCMIWAIT)) { 1263 (cmd != TIOCMIWAIT)) {
1264 if (tty->flags & (1 << TTY_IO_ERROR)) 1264 if (tty_io_error(tty))
1265 return -EIO; 1265 return -EIO;
1266 } 1266 }
1267 1267
@@ -3285,7 +3285,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
3285 printk("%s(%d):%s block_til_ready()\n", 3285 printk("%s(%d):%s block_til_ready()\n",
3286 __FILE__,__LINE__, tty->driver->name ); 3286 __FILE__,__LINE__, tty->driver->name );
3287 3287
3288 if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ 3288 if (filp->f_flags & O_NONBLOCK || tty_io_error(tty)) {
3289 /* nonblock mode is set or port is not enabled */ 3289 /* nonblock mode is set or port is not enabled */
3290 /* just verify that callout device is not active */ 3290 /* just verify that callout device is not active */
3291 port->flags |= ASYNC_NORMAL_ACTIVE; 3291 port->flags |= ASYNC_NORMAL_ACTIVE;
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 9b04d72e752e..320dc4da7162 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1070,7 +1070,7 @@ static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
1070 1070
1071 if (tty_paranoia_check(tty, inode, "tty_read")) 1071 if (tty_paranoia_check(tty, inode, "tty_read"))
1072 return -EIO; 1072 return -EIO;
1073 if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags))) 1073 if (!tty || tty_io_error(tty))
1074 return -EIO; 1074 return -EIO;
1075 1075
1076 /* We want to wait for the line discipline to sort out in this 1076 /* We want to wait for the line discipline to sort out in this
@@ -1245,8 +1245,7 @@ static ssize_t tty_write(struct file *file, const char __user *buf,
1245 1245
1246 if (tty_paranoia_check(tty, file_inode(file), "tty_write")) 1246 if (tty_paranoia_check(tty, file_inode(file), "tty_write"))
1247 return -EIO; 1247 return -EIO;
1248 if (!tty || !tty->ops->write || 1248 if (!tty || !tty->ops->write || tty_io_error(tty))
1249 (test_bit(TTY_IO_ERROR, &tty->flags)))
1250 return -EIO; 1249 return -EIO;
1251 /* Short term debug to catch buggy drivers */ 1250 /* Short term debug to catch buggy drivers */
1252 if (tty->ops->write_room == NULL) 1251 if (tty->ops->write_room == NULL)
diff --git a/drivers/tty/tty_port.c b/drivers/tty/tty_port.c
index dbcca30a54b1..9127c54b803e 100644
--- a/drivers/tty/tty_port.c
+++ b/drivers/tty/tty_port.c
@@ -364,7 +364,7 @@ int tty_port_block_til_ready(struct tty_port *port,
364 364
365 /* if non-blocking mode is set we can pass directly to open unless 365 /* if non-blocking mode is set we can pass directly to open unless
366 the port has just hung up or is in another error state */ 366 the port has just hung up or is in another error state */
367 if (tty->flags & (1 << TTY_IO_ERROR)) { 367 if (tty_io_error(tty)) {
368 port->flags |= ASYNC_NORMAL_ACTIVE; 368 port->flags |= ASYNC_NORMAL_ACTIVE;
369 return 0; 369 return 0;
370 } 370 }