aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/stallion.c272
1 files changed, 136 insertions, 136 deletions
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index 604a2448632d..6a6e5124a5fa 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -187,32 +187,32 @@ static stlbrd_t *stl_brds[STL_MAXBRDS];
187 * referencing boards when printing trace and stuff. 187 * referencing boards when printing trace and stuff.
188 */ 188 */
189static char *stl_brdnames[] = { 189static char *stl_brdnames[] = {
190 (char *) NULL, 190 NULL,
191 (char *) NULL, 191 NULL,
192 (char *) NULL, 192 NULL,
193 (char *) NULL, 193 NULL,
194 (char *) NULL, 194 NULL,
195 (char *) NULL, 195 NULL,
196 (char *) NULL, 196 NULL,
197 (char *) NULL, 197 NULL,
198 (char *) NULL, 198 NULL,
199 (char *) NULL, 199 NULL,
200 (char *) NULL, 200 NULL,
201 (char *) NULL, 201 NULL,
202 (char *) NULL, 202 NULL,
203 (char *) NULL, 203 NULL,
204 (char *) NULL, 204 NULL,
205 (char *) NULL, 205 NULL,
206 (char *) NULL, 206 NULL,
207 (char *) NULL, 207 NULL,
208 (char *) NULL, 208 NULL,
209 (char *) NULL, 209 NULL,
210 "EasyIO", 210 "EasyIO",
211 "EC8/32-AT", 211 "EC8/32-AT",
212 "EC8/32-MC", 212 "EC8/32-MC",
213 (char *) NULL, 213 NULL,
214 (char *) NULL, 214 NULL,
215 (char *) NULL, 215 NULL,
216 "EC8/32-PCI", 216 "EC8/32-PCI",
217 "EC8/64-PCI", 217 "EC8/64-PCI",
218 "EasyIO-PCI", 218 "EasyIO-PCI",
@@ -761,20 +761,20 @@ static void __exit stallion_module_exit(void)
761 class_destroy(stallion_class); 761 class_destroy(stallion_class);
762 762
763 for (i = 0; (i < stl_nrbrds); i++) { 763 for (i = 0; (i < stl_nrbrds); i++) {
764 if ((brdp = stl_brds[i]) == (stlbrd_t *) NULL) 764 if ((brdp = stl_brds[i]) == NULL)
765 continue; 765 continue;
766 766
767 free_irq(brdp->irq, brdp); 767 free_irq(brdp->irq, brdp);
768 768
769 for (j = 0; (j < STL_MAXPANELS); j++) { 769 for (j = 0; (j < STL_MAXPANELS); j++) {
770 panelp = brdp->panels[j]; 770 panelp = brdp->panels[j];
771 if (panelp == (stlpanel_t *) NULL) 771 if (panelp == NULL)
772 continue; 772 continue;
773 for (k = 0; (k < STL_PORTSPERPANEL); k++) { 773 for (k = 0; (k < STL_PORTSPERPANEL); k++) {
774 portp = panelp->ports[k]; 774 portp = panelp->ports[k];
775 if (portp == (stlport_t *) NULL) 775 if (portp == NULL)
776 continue; 776 continue;
777 if (portp->tty != (struct tty_struct *) NULL) 777 if (portp->tty != NULL)
778 stl_hangup(portp->tty); 778 stl_hangup(portp->tty);
779 kfree(portp->tx.buf); 779 kfree(portp->tx.buf);
780 kfree(portp); 780 kfree(portp);
@@ -787,7 +787,7 @@ static void __exit stallion_module_exit(void)
787 release_region(brdp->ioaddr2, brdp->iosize2); 787 release_region(brdp->ioaddr2, brdp->iosize2);
788 788
789 kfree(brdp); 789 kfree(brdp);
790 stl_brds[i] = (stlbrd_t *) NULL; 790 stl_brds[i] = NULL;
791 } 791 }
792} 792}
793 793
@@ -812,7 +812,7 @@ static void stl_argbrds(void)
812 memset(&conf, 0, sizeof(conf)); 812 memset(&conf, 0, sizeof(conf));
813 if (stl_parsebrd(&conf, stl_brdsp[i]) == 0) 813 if (stl_parsebrd(&conf, stl_brdsp[i]) == 0)
814 continue; 814 continue;
815 if ((brdp = stl_allocbrd()) == (stlbrd_t *) NULL) 815 if ((brdp = stl_allocbrd()) == NULL)
816 continue; 816 continue;
817 stl_nrbrds = i + 1; 817 stl_nrbrds = i + 1;
818 brdp->brdnr = i; 818 brdp->brdnr = i;
@@ -874,7 +874,7 @@ static int stl_parsebrd(stlconf_t *confp, char **argp)
874 874
875 pr_debug("stl_parsebrd(confp=%p,argp=%p)\n", confp, argp); 875 pr_debug("stl_parsebrd(confp=%p,argp=%p)\n", confp, argp);
876 876
877 if ((argp[0] == (char *) NULL) || (*argp[0] == 0)) 877 if ((argp[0] == NULL) || (*argp[0] == 0))
878 return 0; 878 return 0;
879 879
880 for (sp = argp[0], i = 0; ((*sp != 0) && (i < 25)); sp++, i++) 880 for (sp = argp[0], i = 0; ((*sp != 0) && (i < 25)); sp++, i++)
@@ -892,15 +892,15 @@ static int stl_parsebrd(stlconf_t *confp, char **argp)
892 confp->brdtype = stl_brdstr[i].type; 892 confp->brdtype = stl_brdstr[i].type;
893 893
894 i = 1; 894 i = 1;
895 if ((argp[i] != (char *) NULL) && (*argp[i] != 0)) 895 if ((argp[i] != NULL) && (*argp[i] != 0))
896 confp->ioaddr1 = stl_atol(argp[i]); 896 confp->ioaddr1 = stl_atol(argp[i]);
897 i++; 897 i++;
898 if (confp->brdtype == BRD_ECH) { 898 if (confp->brdtype == BRD_ECH) {
899 if ((argp[i] != (char *) NULL) && (*argp[i] != 0)) 899 if ((argp[i] != NULL) && (*argp[i] != 0))
900 confp->ioaddr2 = stl_atol(argp[i]); 900 confp->ioaddr2 = stl_atol(argp[i]);
901 i++; 901 i++;
902 } 902 }
903 if ((argp[i] != (char *) NULL) && (*argp[i] != 0)) 903 if ((argp[i] != NULL) && (*argp[i] != 0))
904 confp->irq = stl_atol(argp[i]); 904 confp->irq = stl_atol(argp[i]);
905 return 1; 905 return 1;
906} 906}
@@ -942,11 +942,11 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
942 if (brdnr >= stl_nrbrds) 942 if (brdnr >= stl_nrbrds)
943 return -ENODEV; 943 return -ENODEV;
944 brdp = stl_brds[brdnr]; 944 brdp = stl_brds[brdnr];
945 if (brdp == (stlbrd_t *) NULL) 945 if (brdp == NULL)
946 return -ENODEV; 946 return -ENODEV;
947 minordev = MINOR2PORT(minordev); 947 minordev = MINOR2PORT(minordev);
948 for (portnr = -1, panelnr = 0; (panelnr < STL_MAXPANELS); panelnr++) { 948 for (portnr = -1, panelnr = 0; (panelnr < STL_MAXPANELS); panelnr++) {
949 if (brdp->panels[panelnr] == (stlpanel_t *) NULL) 949 if (brdp->panels[panelnr] == NULL)
950 break; 950 break;
951 if (minordev < brdp->panels[panelnr]->nrports) { 951 if (minordev < brdp->panels[panelnr]->nrports) {
952 portnr = minordev; 952 portnr = minordev;
@@ -958,7 +958,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
958 return -ENODEV; 958 return -ENODEV;
959 959
960 portp = brdp->panels[panelnr]->ports[portnr]; 960 portp = brdp->panels[panelnr]->ports[portnr];
961 if (portp == (stlport_t *) NULL) 961 if (portp == NULL)
962 return -ENODEV; 962 return -ENODEV;
963 963
964/* 964/*
@@ -1080,7 +1080,7 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
1080 pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp); 1080 pr_debug("stl_close(tty=%p,filp=%p)\n", tty, filp);
1081 1081
1082 portp = tty->driver_data; 1082 portp = tty->driver_data;
1083 if (portp == (stlport_t *) NULL) 1083 if (portp == NULL)
1084 return; 1084 return;
1085 1085
1086 spin_lock_irqsave(&stallion_lock, flags); 1086 spin_lock_irqsave(&stallion_lock, flags);
@@ -1123,17 +1123,17 @@ static void stl_close(struct tty_struct *tty, struct file *filp)
1123 stl_enablerxtx(portp, 0, 0); 1123 stl_enablerxtx(portp, 0, 0);
1124 stl_flushbuffer(tty); 1124 stl_flushbuffer(tty);
1125 portp->istate = 0; 1125 portp->istate = 0;
1126 if (portp->tx.buf != (char *) NULL) { 1126 if (portp->tx.buf != NULL) {
1127 kfree(portp->tx.buf); 1127 kfree(portp->tx.buf);
1128 portp->tx.buf = (char *) NULL; 1128 portp->tx.buf = NULL;
1129 portp->tx.head = (char *) NULL; 1129 portp->tx.head = NULL;
1130 portp->tx.tail = (char *) NULL; 1130 portp->tx.tail = NULL;
1131 } 1131 }
1132 set_bit(TTY_IO_ERROR, &tty->flags); 1132 set_bit(TTY_IO_ERROR, &tty->flags);
1133 tty_ldisc_flush(tty); 1133 tty_ldisc_flush(tty);
1134 1134
1135 tty->closing = 0; 1135 tty->closing = 0;
1136 portp->tty = (struct tty_struct *) NULL; 1136 portp->tty = NULL;
1137 1137
1138 if (portp->openwaitcnt) { 1138 if (portp->openwaitcnt) {
1139 if (portp->close_delay) 1139 if (portp->close_delay)
@@ -1162,9 +1162,9 @@ static int stl_write(struct tty_struct *tty, const unsigned char *buf, int count
1162 pr_debug("stl_write(tty=%p,buf=%p,count=%d)\n", tty, buf, count); 1162 pr_debug("stl_write(tty=%p,buf=%p,count=%d)\n", tty, buf, count);
1163 1163
1164 portp = tty->driver_data; 1164 portp = tty->driver_data;
1165 if (portp == (stlport_t *) NULL) 1165 if (portp == NULL)
1166 return 0; 1166 return 0;
1167 if (portp->tx.buf == (char *) NULL) 1167 if (portp->tx.buf == NULL)
1168 return 0; 1168 return 0;
1169 1169
1170/* 1170/*
@@ -1217,12 +1217,12 @@ static void stl_putchar(struct tty_struct *tty, unsigned char ch)
1217 1217
1218 pr_debug("stl_putchar(tty=%p,ch=%x)\n", tty, ch); 1218 pr_debug("stl_putchar(tty=%p,ch=%x)\n", tty, ch);
1219 1219
1220 if (tty == (struct tty_struct *) NULL) 1220 if (tty == NULL)
1221 return; 1221 return;
1222 portp = tty->driver_data; 1222 portp = tty->driver_data;
1223 if (portp == (stlport_t *) NULL) 1223 if (portp == NULL)
1224 return; 1224 return;
1225 if (portp->tx.buf == (char *) NULL) 1225 if (portp->tx.buf == NULL)
1226 return; 1226 return;
1227 1227
1228 head = portp->tx.head; 1228 head = portp->tx.head;
@@ -1253,12 +1253,12 @@ static void stl_flushchars(struct tty_struct *tty)
1253 1253
1254 pr_debug("stl_flushchars(tty=%p)\n", tty); 1254 pr_debug("stl_flushchars(tty=%p)\n", tty);
1255 1255
1256 if (tty == (struct tty_struct *) NULL) 1256 if (tty == NULL)
1257 return; 1257 return;
1258 portp = tty->driver_data; 1258 portp = tty->driver_data;
1259 if (portp == (stlport_t *) NULL) 1259 if (portp == NULL)
1260 return; 1260 return;
1261 if (portp->tx.buf == (char *) NULL) 1261 if (portp->tx.buf == NULL)
1262 return; 1262 return;
1263 1263
1264 stl_startrxtx(portp, -1, 1); 1264 stl_startrxtx(portp, -1, 1);
@@ -1273,12 +1273,12 @@ static int stl_writeroom(struct tty_struct *tty)
1273 1273
1274 pr_debug("stl_writeroom(tty=%p)\n", tty); 1274 pr_debug("stl_writeroom(tty=%p)\n", tty);
1275 1275
1276 if (tty == (struct tty_struct *) NULL) 1276 if (tty == NULL)
1277 return 0; 1277 return 0;
1278 portp = tty->driver_data; 1278 portp = tty->driver_data;
1279 if (portp == (stlport_t *) NULL) 1279 if (portp == NULL)
1280 return 0; 1280 return 0;
1281 if (portp->tx.buf == (char *) NULL) 1281 if (portp->tx.buf == NULL)
1282 return 0; 1282 return 0;
1283 1283
1284 head = portp->tx.head; 1284 head = portp->tx.head;
@@ -1305,12 +1305,12 @@ static int stl_charsinbuffer(struct tty_struct *tty)
1305 1305
1306 pr_debug("stl_charsinbuffer(tty=%p)\n", tty); 1306 pr_debug("stl_charsinbuffer(tty=%p)\n", tty);
1307 1307
1308 if (tty == (struct tty_struct *) NULL) 1308 if (tty == NULL)
1309 return 0; 1309 return 0;
1310 portp = tty->driver_data; 1310 portp = tty->driver_data;
1311 if (portp == (stlport_t *) NULL) 1311 if (portp == NULL)
1312 return 0; 1312 return 0;
1313 if (portp->tx.buf == (char *) NULL) 1313 if (portp->tx.buf == NULL)
1314 return 0; 1314 return 0;
1315 1315
1316 head = portp->tx.head; 1316 head = portp->tx.head;
@@ -1352,7 +1352,7 @@ static int stl_getserial(stlport_t *portp, struct serial_struct __user *sp)
1352 } 1352 }
1353 1353
1354 brdp = stl_brds[portp->brdnr]; 1354 brdp = stl_brds[portp->brdnr];
1355 if (brdp != (stlbrd_t *) NULL) 1355 if (brdp != NULL)
1356 sio.irq = brdp->irq; 1356 sio.irq = brdp->irq;
1357 1357
1358 return copy_to_user(sp, &sio, sizeof(struct serial_struct)) ? -EFAULT : 0; 1358 return copy_to_user(sp, &sio, sizeof(struct serial_struct)) ? -EFAULT : 0;
@@ -1398,10 +1398,10 @@ static int stl_tiocmget(struct tty_struct *tty, struct file *file)
1398{ 1398{
1399 stlport_t *portp; 1399 stlport_t *portp;
1400 1400
1401 if (tty == (struct tty_struct *) NULL) 1401 if (tty == NULL)
1402 return -ENODEV; 1402 return -ENODEV;
1403 portp = tty->driver_data; 1403 portp = tty->driver_data;
1404 if (portp == (stlport_t *) NULL) 1404 if (portp == NULL)
1405 return -ENODEV; 1405 return -ENODEV;
1406 if (tty->flags & (1 << TTY_IO_ERROR)) 1406 if (tty->flags & (1 << TTY_IO_ERROR))
1407 return -EIO; 1407 return -EIO;
@@ -1415,10 +1415,10 @@ static int stl_tiocmset(struct tty_struct *tty, struct file *file,
1415 stlport_t *portp; 1415 stlport_t *portp;
1416 int rts = -1, dtr = -1; 1416 int rts = -1, dtr = -1;
1417 1417
1418 if (tty == (struct tty_struct *) NULL) 1418 if (tty == NULL)
1419 return -ENODEV; 1419 return -ENODEV;
1420 portp = tty->driver_data; 1420 portp = tty->driver_data;
1421 if (portp == (stlport_t *) NULL) 1421 if (portp == NULL)
1422 return -ENODEV; 1422 return -ENODEV;
1423 if (tty->flags & (1 << TTY_IO_ERROR)) 1423 if (tty->flags & (1 << TTY_IO_ERROR))
1424 return -EIO; 1424 return -EIO;
@@ -1446,10 +1446,10 @@ static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd
1446 pr_debug("stl_ioctl(tty=%p,file=%p,cmd=%x,arg=%lx)\n", tty, file, cmd, 1446 pr_debug("stl_ioctl(tty=%p,file=%p,cmd=%x,arg=%lx)\n", tty, file, cmd,
1447 arg); 1447 arg);
1448 1448
1449 if (tty == (struct tty_struct *) NULL) 1449 if (tty == NULL)
1450 return -ENODEV; 1450 return -ENODEV;
1451 portp = tty->driver_data; 1451 portp = tty->driver_data;
1452 if (portp == (stlport_t *) NULL) 1452 if (portp == NULL)
1453 return -ENODEV; 1453 return -ENODEV;
1454 1454
1455 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) && 1455 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1508,10 +1508,10 @@ static void stl_settermios(struct tty_struct *tty, struct termios *old)
1508 1508
1509 pr_debug("stl_settermios(tty=%p,old=%p)\n", tty, old); 1509 pr_debug("stl_settermios(tty=%p,old=%p)\n", tty, old);
1510 1510
1511 if (tty == (struct tty_struct *) NULL) 1511 if (tty == NULL)
1512 return; 1512 return;
1513 portp = tty->driver_data; 1513 portp = tty->driver_data;
1514 if (portp == (stlport_t *) NULL) 1514 if (portp == NULL)
1515 return; 1515 return;
1516 1516
1517 tiosp = tty->termios; 1517 tiosp = tty->termios;
@@ -1543,10 +1543,10 @@ static void stl_throttle(struct tty_struct *tty)
1543 1543
1544 pr_debug("stl_throttle(tty=%p)\n", tty); 1544 pr_debug("stl_throttle(tty=%p)\n", tty);
1545 1545
1546 if (tty == (struct tty_struct *) NULL) 1546 if (tty == NULL)
1547 return; 1547 return;
1548 portp = tty->driver_data; 1548 portp = tty->driver_data;
1549 if (portp == (stlport_t *) NULL) 1549 if (portp == NULL)
1550 return; 1550 return;
1551 stl_flowctrl(portp, 0); 1551 stl_flowctrl(portp, 0);
1552} 1552}
@@ -1563,10 +1563,10 @@ static void stl_unthrottle(struct tty_struct *tty)
1563 1563
1564 pr_debug("stl_unthrottle(tty=%p)\n", tty); 1564 pr_debug("stl_unthrottle(tty=%p)\n", tty);
1565 1565
1566 if (tty == (struct tty_struct *) NULL) 1566 if (tty == NULL)
1567 return; 1567 return;
1568 portp = tty->driver_data; 1568 portp = tty->driver_data;
1569 if (portp == (stlport_t *) NULL) 1569 if (portp == NULL)
1570 return; 1570 return;
1571 stl_flowctrl(portp, 1); 1571 stl_flowctrl(portp, 1);
1572} 1572}
@@ -1584,10 +1584,10 @@ static void stl_stop(struct tty_struct *tty)
1584 1584
1585 pr_debug("stl_stop(tty=%p)\n", tty); 1585 pr_debug("stl_stop(tty=%p)\n", tty);
1586 1586
1587 if (tty == (struct tty_struct *) NULL) 1587 if (tty == NULL)
1588 return; 1588 return;
1589 portp = tty->driver_data; 1589 portp = tty->driver_data;
1590 if (portp == (stlport_t *) NULL) 1590 if (portp == NULL)
1591 return; 1591 return;
1592 stl_startrxtx(portp, -1, 0); 1592 stl_startrxtx(portp, -1, 0);
1593} 1593}
@@ -1604,10 +1604,10 @@ static void stl_start(struct tty_struct *tty)
1604 1604
1605 pr_debug("stl_start(tty=%p)\n", tty); 1605 pr_debug("stl_start(tty=%p)\n", tty);
1606 1606
1607 if (tty == (struct tty_struct *) NULL) 1607 if (tty == NULL)
1608 return; 1608 return;
1609 portp = tty->driver_data; 1609 portp = tty->driver_data;
1610 if (portp == (stlport_t *) NULL) 1610 if (portp == NULL)
1611 return; 1611 return;
1612 stl_startrxtx(portp, -1, 1); 1612 stl_startrxtx(portp, -1, 1);
1613} 1613}
@@ -1626,10 +1626,10 @@ static void stl_hangup(struct tty_struct *tty)
1626 1626
1627 pr_debug("stl_hangup(tty=%p)\n", tty); 1627 pr_debug("stl_hangup(tty=%p)\n", tty);
1628 1628
1629 if (tty == (struct tty_struct *) NULL) 1629 if (tty == NULL)
1630 return; 1630 return;
1631 portp = tty->driver_data; 1631 portp = tty->driver_data;
1632 if (portp == (stlport_t *) NULL) 1632 if (portp == NULL)
1633 return; 1633 return;
1634 1634
1635 portp->flags &= ~ASYNC_INITIALIZED; 1635 portp->flags &= ~ASYNC_INITIALIZED;
@@ -1640,13 +1640,13 @@ static void stl_hangup(struct tty_struct *tty)
1640 stl_flushbuffer(tty); 1640 stl_flushbuffer(tty);
1641 portp->istate = 0; 1641 portp->istate = 0;
1642 set_bit(TTY_IO_ERROR, &tty->flags); 1642 set_bit(TTY_IO_ERROR, &tty->flags);
1643 if (portp->tx.buf != (char *) NULL) { 1643 if (portp->tx.buf != NULL) {
1644 kfree(portp->tx.buf); 1644 kfree(portp->tx.buf);
1645 portp->tx.buf = (char *) NULL; 1645 portp->tx.buf = NULL;
1646 portp->tx.head = (char *) NULL; 1646 portp->tx.head = NULL;
1647 portp->tx.tail = (char *) NULL; 1647 portp->tx.tail = NULL;
1648 } 1648 }
1649 portp->tty = (struct tty_struct *) NULL; 1649 portp->tty = NULL;
1650 portp->flags &= ~ASYNC_NORMAL_ACTIVE; 1650 portp->flags &= ~ASYNC_NORMAL_ACTIVE;
1651 portp->refcount = 0; 1651 portp->refcount = 0;
1652 wake_up_interruptible(&portp->open_wait); 1652 wake_up_interruptible(&portp->open_wait);
@@ -1660,10 +1660,10 @@ static void stl_flushbuffer(struct tty_struct *tty)
1660 1660
1661 pr_debug("stl_flushbuffer(tty=%p)\n", tty); 1661 pr_debug("stl_flushbuffer(tty=%p)\n", tty);
1662 1662
1663 if (tty == (struct tty_struct *) NULL) 1663 if (tty == NULL)
1664 return; 1664 return;
1665 portp = tty->driver_data; 1665 portp = tty->driver_data;
1666 if (portp == (stlport_t *) NULL) 1666 if (portp == NULL)
1667 return; 1667 return;
1668 1668
1669 stl_flush(portp); 1669 stl_flush(portp);
@@ -1678,10 +1678,10 @@ static void stl_breakctl(struct tty_struct *tty, int state)
1678 1678
1679 pr_debug("stl_breakctl(tty=%p,state=%d)\n", tty, state); 1679 pr_debug("stl_breakctl(tty=%p,state=%d)\n", tty, state);
1680 1680
1681 if (tty == (struct tty_struct *) NULL) 1681 if (tty == NULL)
1682 return; 1682 return;
1683 portp = tty->driver_data; 1683 portp = tty->driver_data;
1684 if (portp == (stlport_t *) NULL) 1684 if (portp == NULL)
1685 return; 1685 return;
1686 1686
1687 stl_sendbreak(portp, ((state == -1) ? 1 : 2)); 1687 stl_sendbreak(portp, ((state == -1) ? 1 : 2));
@@ -1696,10 +1696,10 @@ static void stl_waituntilsent(struct tty_struct *tty, int timeout)
1696 1696
1697 pr_debug("stl_waituntilsent(tty=%p,timeout=%d)\n", tty, timeout); 1697 pr_debug("stl_waituntilsent(tty=%p,timeout=%d)\n", tty, timeout);
1698 1698
1699 if (tty == (struct tty_struct *) NULL) 1699 if (tty == NULL)
1700 return; 1700 return;
1701 portp = tty->driver_data; 1701 portp = tty->driver_data;
1702 if (portp == (stlport_t *) NULL) 1702 if (portp == NULL)
1703 return; 1703 return;
1704 1704
1705 if (timeout == 0) 1705 if (timeout == 0)
@@ -1723,10 +1723,10 @@ static void stl_sendxchar(struct tty_struct *tty, char ch)
1723 1723
1724 pr_debug("stl_sendxchar(tty=%p,ch=%x)\n", tty, ch); 1724 pr_debug("stl_sendxchar(tty=%p,ch=%x)\n", tty, ch);
1725 1725
1726 if (tty == (struct tty_struct *) NULL) 1726 if (tty == NULL)
1727 return; 1727 return;
1728 portp = tty->driver_data; 1728 portp = tty->driver_data;
1729 if (portp == (stlport_t *) NULL) 1729 if (portp == NULL)
1730 return; 1730 return;
1731 1731
1732 if (ch == STOP_CHAR(tty)) 1732 if (ch == STOP_CHAR(tty))
@@ -1822,7 +1822,7 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
1822 */ 1822 */
1823 for (brdnr = 0; (brdnr < stl_nrbrds); brdnr++) { 1823 for (brdnr = 0; (brdnr < stl_nrbrds); brdnr++) {
1824 brdp = stl_brds[brdnr]; 1824 brdp = stl_brds[brdnr];
1825 if (brdp == (stlbrd_t *) NULL) 1825 if (brdp == NULL)
1826 continue; 1826 continue;
1827 if (brdp->state == 0) 1827 if (brdp->state == 0)
1828 continue; 1828 continue;
@@ -1836,7 +1836,7 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
1836 totalport = brdnr * STL_MAXPORTS; 1836 totalport = brdnr * STL_MAXPORTS;
1837 for (panelnr = 0; (panelnr < brdp->nrpanels); panelnr++) { 1837 for (panelnr = 0; (panelnr < brdp->nrpanels); panelnr++) {
1838 panelp = brdp->panels[panelnr]; 1838 panelp = brdp->panels[panelnr];
1839 if (panelp == (stlpanel_t *) NULL) 1839 if (panelp == NULL)
1840 continue; 1840 continue;
1841 1841
1842 maxoff = curoff + (panelp->nrports * MAXLINE); 1842 maxoff = curoff + (panelp->nrports * MAXLINE);
@@ -1849,7 +1849,7 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
1849 for (portnr = 0; (portnr < panelp->nrports); portnr++, 1849 for (portnr = 0; (portnr < panelp->nrports); portnr++,
1850 totalport++) { 1850 totalport++) {
1851 portp = panelp->ports[portnr]; 1851 portp = panelp->ports[portnr];
1852 if (portp == (stlport_t *) NULL) 1852 if (portp == NULL)
1853 continue; 1853 continue;
1854 if (off >= (curoff += MAXLINE)) 1854 if (off >= (curoff += MAXLINE))
1855 continue; 1855 continue;
@@ -1876,7 +1876,7 @@ stl_readdone:
1876 1876
1877static irqreturn_t stl_intr(int irq, void *dev_id) 1877static irqreturn_t stl_intr(int irq, void *dev_id)
1878{ 1878{
1879 stlbrd_t *brdp = (stlbrd_t *) dev_id; 1879 stlbrd_t *brdp = dev_id;
1880 1880
1881 pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, irq); 1881 pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, irq);
1882 1882
@@ -2034,11 +2034,11 @@ static void stl_offintr(struct work_struct *work)
2034 2034
2035 pr_debug("stl_offintr(portp=%p)\n", portp); 2035 pr_debug("stl_offintr(portp=%p)\n", portp);
2036 2036
2037 if (portp == (stlport_t *) NULL) 2037 if (portp == NULL)
2038 return; 2038 return;
2039 2039
2040 tty = portp->tty; 2040 tty = portp->tty;
2041 if (tty == (struct tty_struct *) NULL) 2041 if (tty == NULL)
2042 return; 2042 return;
2043 2043
2044 lock_kernel(); 2044 lock_kernel();
@@ -2227,10 +2227,10 @@ static inline int stl_initeio(stlbrd_t *brdp)
2227 panelp->iobase = brdp->ioaddr1; 2227 panelp->iobase = brdp->ioaddr1;
2228 panelp->hwid = status; 2228 panelp->hwid = status;
2229 if ((status & EIO_IDBITMASK) == EIO_MK3) { 2229 if ((status & EIO_IDBITMASK) == EIO_MK3) {
2230 panelp->uartp = (void *) &stl_sc26198uart; 2230 panelp->uartp = &stl_sc26198uart;
2231 panelp->isr = stl_sc26198intr; 2231 panelp->isr = stl_sc26198intr;
2232 } else { 2232 } else {
2233 panelp->uartp = (void *) &stl_cd1400uart; 2233 panelp->uartp = &stl_cd1400uart;
2234 panelp->isr = stl_cd1400eiointr; 2234 panelp->isr = stl_cd1400eiointr;
2235 } 2235 }
2236 2236
@@ -2402,7 +2402,7 @@ static inline int stl_initech(stlbrd_t *brdp)
2402 brdp->bnkstataddr[banknr++] = ioaddr + ECH_PNLSTATUS; 2402 brdp->bnkstataddr[banknr++] = ioaddr + ECH_PNLSTATUS;
2403 2403
2404 if (status & ECH_PNLXPID) { 2404 if (status & ECH_PNLXPID) {
2405 panelp->uartp = (void *) &stl_sc26198uart; 2405 panelp->uartp = &stl_sc26198uart;
2406 panelp->isr = stl_sc26198intr; 2406 panelp->isr = stl_sc26198intr;
2407 if (status & ECH_PNL16PORT) { 2407 if (status & ECH_PNL16PORT) {
2408 panelp->nrports = 16; 2408 panelp->nrports = 16;
@@ -2414,7 +2414,7 @@ static inline int stl_initech(stlbrd_t *brdp)
2414 panelp->nrports = 8; 2414 panelp->nrports = 8;
2415 } 2415 }
2416 } else { 2416 } else {
2417 panelp->uartp = (void *) &stl_cd1400uart; 2417 panelp->uartp = &stl_cd1400uart;
2418 panelp->isr = stl_cd1400echintr; 2418 panelp->isr = stl_cd1400echintr;
2419 if (status & ECH_PNL16PORT) { 2419 if (status & ECH_PNL16PORT) {
2420 panelp->nrports = 16; 2420 panelp->nrports = 16;
@@ -2498,7 +2498,7 @@ static int __init stl_brdinit(stlbrd_t *brdp)
2498 } 2498 }
2499 2499
2500 for (i = 0; (i < STL_MAXPANELS); i++) 2500 for (i = 0; (i < STL_MAXPANELS); i++)
2501 if (brdp->panels[i] != (stlpanel_t *) NULL) 2501 if (brdp->panels[i] != NULL)
2502 stl_initports(brdp, brdp->panels[i]); 2502 stl_initports(brdp, brdp->panels[i]);
2503 2503
2504 printk("STALLION: %s found, board=%d io=%x irq=%d " 2504 printk("STALLION: %s found, board=%d io=%x irq=%d "
@@ -2519,7 +2519,7 @@ static inline int stl_getbrdnr(void)
2519 int i; 2519 int i;
2520 2520
2521 for (i = 0; (i < STL_MAXBRDS); i++) { 2521 for (i = 0; (i < STL_MAXBRDS); i++) {
2522 if (stl_brds[i] == (stlbrd_t *) NULL) { 2522 if (stl_brds[i] == NULL) {
2523 if (i >= stl_nrbrds) 2523 if (i >= stl_nrbrds)
2524 stl_nrbrds = i + 1; 2524 stl_nrbrds = i + 1;
2525 return(i); 2525 return(i);
@@ -2547,7 +2547,7 @@ static inline int stl_initpcibrd(int brdtype, struct pci_dev *devp)
2547 2547
2548 if (pci_enable_device(devp)) 2548 if (pci_enable_device(devp))
2549 return(-EIO); 2549 return(-EIO);
2550 if ((brdp = stl_allocbrd()) == (stlbrd_t *) NULL) 2550 if ((brdp = stl_allocbrd()) == NULL)
2551 return(-ENOMEM); 2551 return(-ENOMEM);
2552 if ((brdp->brdnr = stl_getbrdnr()) < 0) { 2552 if ((brdp->brdnr = stl_getbrdnr()) < 0) {
2553 printk("STALLION: too many boards found, " 2553 printk("STALLION: too many boards found, "
@@ -2657,7 +2657,7 @@ static inline int stl_initbrds(void)
2657 for (i = 0; (i < stl_nrbrds); i++) { 2657 for (i = 0; (i < stl_nrbrds); i++) {
2658 confp = &stl_brdconf[i]; 2658 confp = &stl_brdconf[i];
2659 stl_parsebrd(confp, stl_brdsp[i]); 2659 stl_parsebrd(confp, stl_brdsp[i]);
2660 if ((brdp = stl_allocbrd()) == (stlbrd_t *) NULL) 2660 if ((brdp = stl_allocbrd()) == NULL)
2661 return(-ENOMEM); 2661 return(-ENOMEM);
2662 brdp->brdnr = i; 2662 brdp->brdnr = i;
2663 brdp->brdtype = confp->brdtype; 2663 brdp->brdtype = confp->brdtype;
@@ -2697,7 +2697,7 @@ static int stl_getbrdstats(combrd_t __user *bp)
2697 if (stl_brdstats.brd >= STL_MAXBRDS) 2697 if (stl_brdstats.brd >= STL_MAXBRDS)
2698 return(-ENODEV); 2698 return(-ENODEV);
2699 brdp = stl_brds[stl_brdstats.brd]; 2699 brdp = stl_brds[stl_brdstats.brd];
2700 if (brdp == (stlbrd_t *) NULL) 2700 if (brdp == NULL)
2701 return(-ENODEV); 2701 return(-ENODEV);
2702 2702
2703 memset(&stl_brdstats, 0, sizeof(combrd_t)); 2703 memset(&stl_brdstats, 0, sizeof(combrd_t));
@@ -2732,17 +2732,17 @@ static stlport_t *stl_getport(int brdnr, int panelnr, int portnr)
2732 stlpanel_t *panelp; 2732 stlpanel_t *panelp;
2733 2733
2734 if ((brdnr < 0) || (brdnr >= STL_MAXBRDS)) 2734 if ((brdnr < 0) || (brdnr >= STL_MAXBRDS))
2735 return((stlport_t *) NULL); 2735 return(NULL);
2736 brdp = stl_brds[brdnr]; 2736 brdp = stl_brds[brdnr];
2737 if (brdp == (stlbrd_t *) NULL) 2737 if (brdp == NULL)
2738 return((stlport_t *) NULL); 2738 return(NULL);
2739 if ((panelnr < 0) || (panelnr >= brdp->nrpanels)) 2739 if ((panelnr < 0) || (panelnr >= brdp->nrpanels))
2740 return((stlport_t *) NULL); 2740 return(NULL);
2741 panelp = brdp->panels[panelnr]; 2741 panelp = brdp->panels[panelnr];
2742 if (panelp == (stlpanel_t *) NULL) 2742 if (panelp == NULL)
2743 return((stlport_t *) NULL); 2743 return(NULL);
2744 if ((portnr < 0) || (portnr >= panelp->nrports)) 2744 if ((portnr < 0) || (portnr >= panelp->nrports))
2745 return((stlport_t *) NULL); 2745 return(NULL);
2746 return(panelp->ports[portnr]); 2746 return(panelp->ports[portnr]);
2747} 2747}
2748 2748
@@ -2764,7 +2764,7 @@ static int stl_getportstats(stlport_t *portp, comstats_t __user *cp)
2764 return -EFAULT; 2764 return -EFAULT;
2765 portp = stl_getport(stl_comstats.brd, stl_comstats.panel, 2765 portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
2766 stl_comstats.port); 2766 stl_comstats.port);
2767 if (portp == (stlport_t *) NULL) 2767 if (portp == NULL)
2768 return(-ENODEV); 2768 return(-ENODEV);
2769 } 2769 }
2770 2770
@@ -2780,12 +2780,12 @@ static int stl_getportstats(stlport_t *portp, comstats_t __user *cp)
2780 portp->stats.rxbuffered = 0; 2780 portp->stats.rxbuffered = 0;
2781 2781
2782 spin_lock_irqsave(&stallion_lock, flags); 2782 spin_lock_irqsave(&stallion_lock, flags);
2783 if (portp->tty != (struct tty_struct *) NULL) { 2783 if (portp->tty != NULL) {
2784 if (portp->tty->driver_data == portp) { 2784 if (portp->tty->driver_data == portp) {
2785 portp->stats.ttystate = portp->tty->flags; 2785 portp->stats.ttystate = portp->tty->flags;
2786 /* No longer available as a statistic */ 2786 /* No longer available as a statistic */
2787 portp->stats.rxbuffered = 1; /*portp->tty->flip.count; */ 2787 portp->stats.rxbuffered = 1; /*portp->tty->flip.count; */
2788 if (portp->tty->termios != (struct termios *) NULL) { 2788 if (portp->tty->termios != NULL) {
2789 portp->stats.cflags = portp->tty->termios->c_cflag; 2789 portp->stats.cflags = portp->tty->termios->c_cflag;
2790 portp->stats.iflags = portp->tty->termios->c_iflag; 2790 portp->stats.iflags = portp->tty->termios->c_iflag;
2791 portp->stats.oflags = portp->tty->termios->c_oflag; 2791 portp->stats.oflags = portp->tty->termios->c_oflag;
@@ -2819,7 +2819,7 @@ static int stl_clrportstats(stlport_t *portp, comstats_t __user *cp)
2819 return -EFAULT; 2819 return -EFAULT;
2820 portp = stl_getport(stl_comstats.brd, stl_comstats.panel, 2820 portp = stl_getport(stl_comstats.brd, stl_comstats.panel,
2821 stl_comstats.port); 2821 stl_comstats.port);
2822 if (portp == (stlport_t *) NULL) 2822 if (portp == NULL)
2823 return(-ENODEV); 2823 return(-ENODEV);
2824 } 2824 }
2825 2825
@@ -3090,8 +3090,8 @@ static void stl_cd1400portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *po
3090 pr_debug("stl_cd1400portinit(brdp=%p,panelp=%p,portp=%p)\n", brdp, 3090 pr_debug("stl_cd1400portinit(brdp=%p,panelp=%p,portp=%p)\n", brdp,
3091 panelp, portp); 3091 panelp, portp);
3092 3092
3093 if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) || 3093 if ((brdp == NULL) || (panelp == NULL) ||
3094 (portp == (stlport_t *) NULL)) 3094 (portp == NULL))
3095 return; 3095 return;
3096 3096
3097 spin_lock_irqsave(&brd_lock, flags); 3097 spin_lock_irqsave(&brd_lock, flags);
@@ -3162,7 +3162,7 @@ static void stl_cd1400setport(stlport_t *portp, struct termios *tiosp)
3162 sreroff = 0; 3162 sreroff = 0;
3163 3163
3164 brdp = stl_brds[portp->brdnr]; 3164 brdp = stl_brds[portp->brdnr];
3165 if (brdp == (stlbrd_t *) NULL) 3165 if (brdp == NULL)
3166 return; 3166 return;
3167 3167
3168/* 3168/*
@@ -3546,10 +3546,10 @@ static void stl_cd1400flowctrl(stlport_t *portp, int state)
3546 3546
3547 pr_debug("stl_cd1400flowctrl(portp=%p,state=%x)\n", portp, state); 3547 pr_debug("stl_cd1400flowctrl(portp=%p,state=%x)\n", portp, state);
3548 3548
3549 if (portp == (stlport_t *) NULL) 3549 if (portp == NULL)
3550 return; 3550 return;
3551 tty = portp->tty; 3551 tty = portp->tty;
3552 if (tty == (struct tty_struct *) NULL) 3552 if (tty == NULL)
3553 return; 3553 return;
3554 3554
3555 spin_lock_irqsave(&brd_lock, flags); 3555 spin_lock_irqsave(&brd_lock, flags);
@@ -3608,10 +3608,10 @@ static void stl_cd1400sendflow(stlport_t *portp, int state)
3608 3608
3609 pr_debug("stl_cd1400sendflow(portp=%p,state=%x)\n", portp, state); 3609 pr_debug("stl_cd1400sendflow(portp=%p,state=%x)\n", portp, state);
3610 3610
3611 if (portp == (stlport_t *) NULL) 3611 if (portp == NULL)
3612 return; 3612 return;
3613 tty = portp->tty; 3613 tty = portp->tty;
3614 if (tty == (struct tty_struct *) NULL) 3614 if (tty == NULL)
3615 return; 3615 return;
3616 3616
3617 spin_lock_irqsave(&brd_lock, flags); 3617 spin_lock_irqsave(&brd_lock, flags);
@@ -3640,7 +3640,7 @@ static void stl_cd1400flush(stlport_t *portp)
3640 3640
3641 pr_debug("stl_cd1400flush(portp=%p)\n", portp); 3641 pr_debug("stl_cd1400flush(portp=%p)\n", portp);
3642 3642
3643 if (portp == (stlport_t *) NULL) 3643 if (portp == NULL)
3644 return; 3644 return;
3645 3645
3646 spin_lock_irqsave(&brd_lock, flags); 3646 spin_lock_irqsave(&brd_lock, flags);
@@ -3667,7 +3667,7 @@ static int stl_cd1400datastate(stlport_t *portp)
3667{ 3667{
3668 pr_debug("stl_cd1400datastate(portp=%p)\n", portp); 3668 pr_debug("stl_cd1400datastate(portp=%p)\n", portp);
3669 3669
3670 if (portp == (stlport_t *) NULL) 3670 if (portp == NULL)
3671 return 0; 3671 return 0;
3672 3672
3673 return test_bit(ASYI_TXBUSY, &portp->istate) ? 1 : 0; 3673 return test_bit(ASYI_TXBUSY, &portp->istate) ? 1 : 0;
@@ -4092,8 +4092,8 @@ static void stl_sc26198portinit(stlbrd_t *brdp, stlpanel_t *panelp, stlport_t *p
4092 pr_debug("stl_sc26198portinit(brdp=%p,panelp=%p,portp=%p)\n", brdp, 4092 pr_debug("stl_sc26198portinit(brdp=%p,panelp=%p,portp=%p)\n", brdp,
4093 panelp, portp); 4093 panelp, portp);
4094 4094
4095 if ((brdp == (stlbrd_t *) NULL) || (panelp == (stlpanel_t *) NULL) || 4095 if ((brdp == NULL) || (panelp == NULL) ||
4096 (portp == (stlport_t *) NULL)) 4096 (portp == NULL))
4097 return; 4097 return;
4098 4098
4099 portp->ioaddr = panelp->iobase + ((portp->portnr < 8) ? 0 : 4); 4099 portp->ioaddr = panelp->iobase + ((portp->portnr < 8) ? 0 : 4);
@@ -4130,7 +4130,7 @@ static void stl_sc26198setport(stlport_t *portp, struct termios *tiosp)
4130 imroff = 0; 4130 imroff = 0;
4131 4131
4132 brdp = stl_brds[portp->brdnr]; 4132 brdp = stl_brds[portp->brdnr];
4133 if (brdp == (stlbrd_t *) NULL) 4133 if (brdp == NULL)
4134 return; 4134 return;
4135 4135
4136/* 4136/*
@@ -4482,10 +4482,10 @@ static void stl_sc26198flowctrl(stlport_t *portp, int state)
4482 4482
4483 pr_debug("stl_sc26198flowctrl(portp=%p,state=%x)\n", portp, state); 4483 pr_debug("stl_sc26198flowctrl(portp=%p,state=%x)\n", portp, state);
4484 4484
4485 if (portp == (stlport_t *) NULL) 4485 if (portp == NULL)
4486 return; 4486 return;
4487 tty = portp->tty; 4487 tty = portp->tty;
4488 if (tty == (struct tty_struct *) NULL) 4488 if (tty == NULL)
4489 return; 4489 return;
4490 4490
4491 spin_lock_irqsave(&brd_lock, flags); 4491 spin_lock_irqsave(&brd_lock, flags);
@@ -4551,10 +4551,10 @@ static void stl_sc26198sendflow(stlport_t *portp, int state)
4551 4551
4552 pr_debug("stl_sc26198sendflow(portp=%p,state=%x)\n", portp, state); 4552 pr_debug("stl_sc26198sendflow(portp=%p,state=%x)\n", portp, state);
4553 4553
4554 if (portp == (stlport_t *) NULL) 4554 if (portp == NULL)
4555 return; 4555 return;
4556 tty = portp->tty; 4556 tty = portp->tty;
4557 if (tty == (struct tty_struct *) NULL) 4557 if (tty == NULL)
4558 return; 4558 return;
4559 4559
4560 spin_lock_irqsave(&brd_lock, flags); 4560 spin_lock_irqsave(&brd_lock, flags);
@@ -4588,7 +4588,7 @@ static void stl_sc26198flush(stlport_t *portp)
4588 4588
4589 pr_debug("stl_sc26198flush(portp=%p)\n", portp); 4589 pr_debug("stl_sc26198flush(portp=%p)\n", portp);
4590 4590
4591 if (portp == (stlport_t *) NULL) 4591 if (portp == NULL)
4592 return; 4592 return;
4593 4593
4594 spin_lock_irqsave(&brd_lock, flags); 4594 spin_lock_irqsave(&brd_lock, flags);
@@ -4617,7 +4617,7 @@ static int stl_sc26198datastate(stlport_t *portp)
4617 4617
4618 pr_debug("stl_sc26198datastate(portp=%p)\n", portp); 4618 pr_debug("stl_sc26198datastate(portp=%p)\n", portp);
4619 4619
4620 if (portp == (stlport_t *) NULL) 4620 if (portp == NULL)
4621 return 0; 4621 return 0;
4622 if (test_bit(ASYI_TXBUSY, &portp->istate)) 4622 if (test_bit(ASYI_TXBUSY, &portp->istate))
4623 return 1; 4623 return 1;
@@ -4644,7 +4644,7 @@ static void stl_sc26198wait(stlport_t *portp)
4644 4644
4645 pr_debug("stl_sc26198wait(portp=%p)\n", portp); 4645 pr_debug("stl_sc26198wait(portp=%p)\n", portp);
4646 4646
4647 if (portp == (stlport_t *) NULL) 4647 if (portp == NULL)
4648 return; 4648 return;
4649 4649
4650 for (i = 0; (i < 20); i++) 4650 for (i = 0; (i < 20); i++)
@@ -4816,8 +4816,8 @@ static void stl_sc26198rxisr(stlport_t *portp, unsigned int iack)
4816 * flow control modes of the sc26198. 4816 * flow control modes of the sc26198.
4817 */ 4817 */
4818 if (test_bit(ASYI_TXFLOWED, &portp->istate)) { 4818 if (test_bit(ASYI_TXFLOWED, &portp->istate)) {
4819 if ((tty != (struct tty_struct *) NULL) && 4819 if ((tty != NULL) &&
4820 (tty->termios != (struct termios *) NULL) && 4820 (tty->termios != NULL) &&
4821 (tty->termios->c_iflag & IXANY)) { 4821 (tty->termios->c_iflag & IXANY)) {
4822 stl_sc26198txunflow(portp, tty); 4822 stl_sc26198txunflow(portp, tty);
4823 } 4823 }
@@ -4847,7 +4847,7 @@ static inline void stl_sc26198rxbadch(stlport_t *portp, unsigned char status, ch
4847 if (status & SR_RXBREAK) 4847 if (status & SR_RXBREAK)
4848 portp->stats.rxbreaks++; 4848 portp->stats.rxbreaks++;
4849 4849
4850 if ((tty != (struct tty_struct *) NULL) && 4850 if ((tty != NULL) &&
4851 ((portp->rxignoremsk & status) == 0)) { 4851 ((portp->rxignoremsk & status) == 0)) {
4852 if (portp->rxmarkmsk & status) { 4852 if (portp->rxmarkmsk & status) {
4853 if (status & SR_RXBREAK) { 4853 if (status & SR_RXBREAK) {