aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/riscom8.c145
-rw-r--r--drivers/char/riscom8.h8
2 files changed, 68 insertions, 85 deletions
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index f073c710ab8d..b0ba241361e4 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -322,7 +322,7 @@ static struct riscom_port *rc_get_port(struct riscom_board const *bp,
322 channel = rc_in(bp, CD180_GICR) >> GICR_CHAN_OFF; 322 channel = rc_in(bp, CD180_GICR) >> GICR_CHAN_OFF;
323 if (channel < CD180_NCH) { 323 if (channel < CD180_NCH) {
324 port = &rc_port[board_No(bp) * RC_NPORT + channel]; 324 port = &rc_port[board_No(bp) * RC_NPORT + channel];
325 if (port->flags & ASYNC_INITIALIZED) 325 if (port->port.flags & ASYNC_INITIALIZED)
326 return port; 326 return port;
327 } 327 }
328 printk(KERN_ERR "rc%d: %s interrupt from invalid port %d\n", 328 printk(KERN_ERR "rc%d: %s interrupt from invalid port %d\n",
@@ -341,7 +341,7 @@ static void rc_receive_exc(struct riscom_board const *bp)
341 if (port == NULL) 341 if (port == NULL)
342 return; 342 return;
343 343
344 tty = port->tty; 344 tty = port->port.tty;
345 345
346#ifdef RC_REPORT_OVERRUN 346#ifdef RC_REPORT_OVERRUN
347 status = rc_in(bp, CD180_RCSR); 347 status = rc_in(bp, CD180_RCSR);
@@ -364,7 +364,7 @@ static void rc_receive_exc(struct riscom_board const *bp)
364 printk(KERN_INFO "rc%d: port %d: Handling break...\n", 364 printk(KERN_INFO "rc%d: port %d: Handling break...\n",
365 board_No(bp), port_No(port)); 365 board_No(bp), port_No(port));
366 flag = TTY_BREAK; 366 flag = TTY_BREAK;
367 if (port->flags & ASYNC_SAK) 367 if (port->port.flags & ASYNC_SAK)
368 do_SAK(tty); 368 do_SAK(tty);
369 369
370 } else if (status & RCSR_PE) 370 } else if (status & RCSR_PE)
@@ -392,7 +392,7 @@ static void rc_receive(struct riscom_board const *bp)
392 if (port == NULL) 392 if (port == NULL)
393 return; 393 return;
394 394
395 tty = port->tty; 395 tty = port->port.tty;
396 396
397 count = rc_in(bp, CD180_RDCR); 397 count = rc_in(bp, CD180_RDCR);
398 398
@@ -422,7 +422,7 @@ static void rc_transmit(struct riscom_board const *bp)
422 if (port == NULL) 422 if (port == NULL)
423 return; 423 return;
424 424
425 tty = port->tty; 425 tty = port->port.tty;
426 426
427 if (port->IER & IER_TXEMPTY) { 427 if (port->IER & IER_TXEMPTY) {
428 /* FIFO drained */ 428 /* FIFO drained */
@@ -467,7 +467,7 @@ static void rc_transmit(struct riscom_board const *bp)
467 467
468 count = CD180_NFIFO; 468 count = CD180_NFIFO;
469 do { 469 do {
470 rc_out(bp, CD180_TDR, port->xmit_buf[port->xmit_tail++]); 470 rc_out(bp, CD180_TDR, port->port.xmit_buf[port->xmit_tail++]);
471 port->xmit_tail = port->xmit_tail & (SERIAL_XMIT_SIZE-1); 471 port->xmit_tail = port->xmit_tail & (SERIAL_XMIT_SIZE-1);
472 if (--port->xmit_cnt <= 0) 472 if (--port->xmit_cnt <= 0)
473 break; 473 break;
@@ -492,12 +492,12 @@ static void rc_check_modem(struct riscom_board const *bp)
492 if (port == NULL) 492 if (port == NULL)
493 return; 493 return;
494 494
495 tty = port->tty; 495 tty = port->port.tty;
496 496
497 mcr = rc_in(bp, CD180_MCR); 497 mcr = rc_in(bp, CD180_MCR);
498 if (mcr & MCR_CDCHG) { 498 if (mcr & MCR_CDCHG) {
499 if (rc_in(bp, CD180_MSVR) & MSVR_CD) 499 if (rc_in(bp, CD180_MSVR) & MSVR_CD)
500 wake_up_interruptible(&port->open_wait); 500 wake_up_interruptible(&port->port.open_wait);
501 else 501 else
502 tty_hangup(tty); 502 tty_hangup(tty);
503 } 503 }
@@ -632,7 +632,7 @@ static void rc_shutdown_board(struct riscom_board *bp)
632 */ 632 */
633static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port) 633static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port)
634{ 634{
635 struct tty_struct *tty = port->tty; 635 struct tty_struct *tty = port->port.tty;
636 unsigned long baud; 636 unsigned long baud;
637 long tmp; 637 long tmp;
638 unsigned char cor1 = 0, cor3 = 0; 638 unsigned char cor1 = 0, cor3 = 0;
@@ -786,28 +786,21 @@ static int rc_setup_port(struct riscom_board *bp, struct riscom_port *port)
786{ 786{
787 unsigned long flags; 787 unsigned long flags;
788 788
789 if (port->flags & ASYNC_INITIALIZED) 789 if (port->port.flags & ASYNC_INITIALIZED)
790 return 0; 790 return 0;
791 791
792 if (!port->xmit_buf) { 792 if (tty_port_alloc_xmit_buf(&port->port) < 0)
793 /* We may sleep in get_zeroed_page() */ 793 return -ENOMEM;
794 unsigned long tmp = get_zeroed_page(GFP_KERNEL); 794
795 if (tmp == 0)
796 return -ENOMEM;
797 if (port->xmit_buf)
798 free_page(tmp);
799 else
800 port->xmit_buf = (unsigned char *) tmp;
801 }
802 spin_lock_irqsave(&riscom_lock, flags); 795 spin_lock_irqsave(&riscom_lock, flags);
803 796
804 if (port->tty) 797 if (port->port.tty)
805 clear_bit(TTY_IO_ERROR, &port->tty->flags); 798 clear_bit(TTY_IO_ERROR, &port->port.tty->flags);
806 if (port->count == 1) 799 if (port->port.count == 1)
807 bp->count++; 800 bp->count++;
808 port->xmit_cnt = port->xmit_head = port->xmit_tail = 0; 801 port->xmit_cnt = port->xmit_head = port->xmit_tail = 0;
809 rc_change_speed(bp, port); 802 rc_change_speed(bp, port);
810 port->flags |= ASYNC_INITIALIZED; 803 port->port.flags |= ASYNC_INITIALIZED;
811 804
812 spin_unlock_irqrestore(&riscom_lock, flags); 805 spin_unlock_irqrestore(&riscom_lock, flags);
813 return 0; 806 return 0;
@@ -818,7 +811,7 @@ static void rc_shutdown_port(struct riscom_board *bp, struct riscom_port *port)
818{ 811{
819 struct tty_struct *tty; 812 struct tty_struct *tty;
820 813
821 if (!(port->flags & ASYNC_INITIALIZED)) 814 if (!(port->port.flags & ASYNC_INITIALIZED))
822 return; 815 return;
823 816
824#ifdef RC_REPORT_OVERRUN 817#ifdef RC_REPORT_OVERRUN
@@ -836,12 +829,9 @@ static void rc_shutdown_port(struct riscom_board *bp, struct riscom_port *port)
836 printk("].\n"); 829 printk("].\n");
837 } 830 }
838#endif 831#endif
839 if (port->xmit_buf) { 832 tty_port_free_xmit_buf(&port->port);
840 free_page((unsigned long) port->xmit_buf);
841 port->xmit_buf = NULL;
842 }
843 833
844 tty = port->tty; 834 tty = port->port.tty;
845 835
846 if (tty == NULL || C_HUPCL(tty)) { 836 if (tty == NULL || C_HUPCL(tty)) {
847 /* Drop DTR */ 837 /* Drop DTR */
@@ -860,7 +850,7 @@ static void rc_shutdown_port(struct riscom_board *bp, struct riscom_port *port)
860 850
861 if (tty) 851 if (tty)
862 set_bit(TTY_IO_ERROR, &tty->flags); 852 set_bit(TTY_IO_ERROR, &tty->flags);
863 port->flags &= ~ASYNC_INITIALIZED; 853 port->port.flags &= ~ASYNC_INITIALIZED;
864 854
865 if (--bp->count < 0) { 855 if (--bp->count < 0) {
866 printk(KERN_INFO "rc%d: rc_shutdown_port: " 856 printk(KERN_INFO "rc%d: rc_shutdown_port: "
@@ -890,9 +880,9 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
890 * If the device is in the middle of being closed, then block 880 * If the device is in the middle of being closed, then block
891 * until it's done, and then try again. 881 * until it's done, and then try again.
892 */ 882 */
893 if (tty_hung_up_p(filp) || port->flags & ASYNC_CLOSING) { 883 if (tty_hung_up_p(filp) || port->port.flags & ASYNC_CLOSING) {
894 interruptible_sleep_on(&port->close_wait); 884 interruptible_sleep_on(&port->port.close_wait);
895 if (port->flags & ASYNC_HUP_NOTIFY) 885 if (port->port.flags & ASYNC_HUP_NOTIFY)
896 return -EAGAIN; 886 return -EAGAIN;
897 else 887 else
898 return -ERESTARTSYS; 888 return -ERESTARTSYS;
@@ -904,7 +894,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
904 */ 894 */
905 if ((filp->f_flags & O_NONBLOCK) || 895 if ((filp->f_flags & O_NONBLOCK) ||
906 (tty->flags & (1 << TTY_IO_ERROR))) { 896 (tty->flags & (1 << TTY_IO_ERROR))) {
907 port->flags |= ASYNC_NORMAL_ACTIVE; 897 port->port.flags |= ASYNC_NORMAL_ACTIVE;
908 return 0; 898 return 0;
909 } 899 }
910 900
@@ -919,16 +909,16 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
919 * exit, either normal or abnormal. 909 * exit, either normal or abnormal.
920 */ 910 */
921 retval = 0; 911 retval = 0;
922 add_wait_queue(&port->open_wait, &wait); 912 add_wait_queue(&port->port.open_wait, &wait);
923 913
924 spin_lock_irqsave(&riscom_lock, flags); 914 spin_lock_irqsave(&riscom_lock, flags);
925 915
926 if (!tty_hung_up_p(filp)) 916 if (!tty_hung_up_p(filp))
927 port->count--; 917 port->port.count--;
928 918
929 spin_unlock_irqrestore(&riscom_lock, flags); 919 spin_unlock_irqrestore(&riscom_lock, flags);
930 920
931 port->blocked_open++; 921 port->port.blocked_open++;
932 while (1) { 922 while (1) {
933 spin_lock_irqsave(&riscom_lock, flags); 923 spin_lock_irqsave(&riscom_lock, flags);
934 924
@@ -942,14 +932,14 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
942 932
943 set_current_state(TASK_INTERRUPTIBLE); 933 set_current_state(TASK_INTERRUPTIBLE);
944 if (tty_hung_up_p(filp) || 934 if (tty_hung_up_p(filp) ||
945 !(port->flags & ASYNC_INITIALIZED)) { 935 !(port->port.flags & ASYNC_INITIALIZED)) {
946 if (port->flags & ASYNC_HUP_NOTIFY) 936 if (port->port.flags & ASYNC_HUP_NOTIFY)
947 retval = -EAGAIN; 937 retval = -EAGAIN;
948 else 938 else
949 retval = -ERESTARTSYS; 939 retval = -ERESTARTSYS;
950 break; 940 break;
951 } 941 }
952 if (!(port->flags & ASYNC_CLOSING) && 942 if (!(port->port.flags & ASYNC_CLOSING) &&
953 (do_clocal || CD)) 943 (do_clocal || CD))
954 break; 944 break;
955 if (signal_pending(current)) { 945 if (signal_pending(current)) {
@@ -959,14 +949,14 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
959 schedule(); 949 schedule();
960 } 950 }
961 __set_current_state(TASK_RUNNING); 951 __set_current_state(TASK_RUNNING);
962 remove_wait_queue(&port->open_wait, &wait); 952 remove_wait_queue(&port->port.open_wait, &wait);
963 if (!tty_hung_up_p(filp)) 953 if (!tty_hung_up_p(filp))
964 port->count++; 954 port->port.count++;
965 port->blocked_open--; 955 port->port.blocked_open--;
966 if (retval) 956 if (retval)
967 return retval; 957 return retval;
968 958
969 port->flags |= ASYNC_NORMAL_ACTIVE; 959 port->port.flags |= ASYNC_NORMAL_ACTIVE;
970 return 0; 960 return 0;
971} 961}
972 962
@@ -990,9 +980,9 @@ static int rc_open(struct tty_struct *tty, struct file *filp)
990 if (error) 980 if (error)
991 return error; 981 return error;
992 982
993 port->count++; 983 port->port.count++;
994 tty->driver_data = port; 984 tty->driver_data = port;
995 port->tty = tty; 985 port->port.tty = tty;
996 986
997 error = rc_setup_port(bp, port); 987 error = rc_setup_port(bp, port);
998 if (error == 0) 988 if (error == 0)
@@ -1031,21 +1021,21 @@ static void rc_close(struct tty_struct *tty, struct file *filp)
1031 goto out; 1021 goto out;
1032 1022
1033 bp = port_Board(port); 1023 bp = port_Board(port);
1034 if ((tty->count == 1) && (port->count != 1)) { 1024 if ((tty->count == 1) && (port->port.count != 1)) {
1035 printk(KERN_INFO "rc%d: rc_close: bad port count;" 1025 printk(KERN_INFO "rc%d: rc_close: bad port count;"
1036 " tty->count is 1, port count is %d\n", 1026 " tty->count is 1, port count is %d\n",
1037 board_No(bp), port->count); 1027 board_No(bp), port->port.count);
1038 port->count = 1; 1028 port->port.count = 1;
1039 } 1029 }
1040 if (--port->count < 0) { 1030 if (--port->port.count < 0) {
1041 printk(KERN_INFO "rc%d: rc_close: bad port count " 1031 printk(KERN_INFO "rc%d: rc_close: bad port count "
1042 "for tty%d: %d\n", 1032 "for tty%d: %d\n",
1043 board_No(bp), port_No(port), port->count); 1033 board_No(bp), port_No(port), port->port.count);
1044 port->count = 0; 1034 port->port.count = 0;
1045 } 1035 }
1046 if (port->count) 1036 if (port->port.count)
1047 goto out; 1037 goto out;
1048 port->flags |= ASYNC_CLOSING; 1038 port->port.flags |= ASYNC_CLOSING;
1049 /* 1039 /*
1050 * Now we wait for the transmit buffer to clear; and we notify 1040 * Now we wait for the transmit buffer to clear; and we notify
1051 * the line discipline to only process XON/XOFF characters. 1041 * the line discipline to only process XON/XOFF characters.
@@ -1060,7 +1050,7 @@ static void rc_close(struct tty_struct *tty, struct file *filp)
1060 * line status register. 1050 * line status register.
1061 */ 1051 */
1062 port->IER &= ~IER_RXD; 1052 port->IER &= ~IER_RXD;
1063 if (port->flags & ASYNC_INITIALIZED) { 1053 if (port->port.flags & ASYNC_INITIALIZED) {
1064 port->IER &= ~IER_TXRDY; 1054 port->IER &= ~IER_TXRDY;
1065 port->IER |= IER_TXEMPTY; 1055 port->IER |= IER_TXEMPTY;
1066 rc_out(bp, CD180_CAR, port_No(port)); 1056 rc_out(bp, CD180_CAR, port_No(port));
@@ -1082,14 +1072,14 @@ static void rc_close(struct tty_struct *tty, struct file *filp)
1082 tty_ldisc_flush(tty); 1072 tty_ldisc_flush(tty);
1083 1073
1084 tty->closing = 0; 1074 tty->closing = 0;
1085 port->tty = NULL; 1075 port->port.tty = NULL;
1086 if (port->blocked_open) { 1076 if (port->port.blocked_open) {
1087 if (port->close_delay) 1077 if (port->close_delay)
1088 msleep_interruptible(jiffies_to_msecs(port->close_delay)); 1078 msleep_interruptible(jiffies_to_msecs(port->close_delay));
1089 wake_up_interruptible(&port->open_wait); 1079 wake_up_interruptible(&port->port.open_wait);
1090 } 1080 }
1091 port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING); 1081 port->port.flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
1092 wake_up_interruptible(&port->close_wait); 1082 wake_up_interruptible(&port->port.close_wait);
1093 1083
1094out: 1084out:
1095 spin_unlock_irqrestore(&riscom_lock, flags); 1085 spin_unlock_irqrestore(&riscom_lock, flags);
@@ -1108,7 +1098,7 @@ static int rc_write(struct tty_struct *tty,
1108 1098
1109 bp = port_Board(port); 1099 bp = port_Board(port);
1110 1100
1111 if (!tty || !port->xmit_buf) 1101 if (!tty || !port->port.xmit_buf)
1112 return 0; 1102 return 0;
1113 1103
1114 while (1) { 1104 while (1) {
@@ -1119,7 +1109,7 @@ static int rc_write(struct tty_struct *tty,
1119 if (c <= 0) 1109 if (c <= 0)
1120 break; /* lock continues to be held */ 1110 break; /* lock continues to be held */
1121 1111
1122 memcpy(port->xmit_buf + port->xmit_head, buf, c); 1112 memcpy(port->port.xmit_buf + port->xmit_head, buf, c);
1123 port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1); 1113 port->xmit_head = (port->xmit_head + c) & (SERIAL_XMIT_SIZE-1);
1124 port->xmit_cnt += c; 1114 port->xmit_cnt += c;
1125 1115
@@ -1151,7 +1141,7 @@ static int rc_put_char(struct tty_struct *tty, unsigned char ch)
1151 if (rc_paranoia_check(port, tty->name, "rc_put_char")) 1141 if (rc_paranoia_check(port, tty->name, "rc_put_char"))
1152 return 0; 1142 return 0;
1153 1143
1154 if (!tty || !port->xmit_buf) 1144 if (!tty || !port->port.xmit_buf)
1155 return 0; 1145 return 0;
1156 1146
1157 spin_lock_irqsave(&riscom_lock, flags); 1147 spin_lock_irqsave(&riscom_lock, flags);
@@ -1159,7 +1149,7 @@ static int rc_put_char(struct tty_struct *tty, unsigned char ch)
1159 if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) 1149 if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1)
1160 goto out; 1150 goto out;
1161 1151
1162 port->xmit_buf[port->xmit_head++] = ch; 1152 port->port.xmit_buf[port->xmit_head++] = ch;
1163 port->xmit_head &= SERIAL_XMIT_SIZE - 1; 1153 port->xmit_head &= SERIAL_XMIT_SIZE - 1;
1164 port->xmit_cnt++; 1154 port->xmit_cnt++;
1165 ret = 1; 1155 ret = 1;
@@ -1178,7 +1168,7 @@ static void rc_flush_chars(struct tty_struct *tty)
1178 return; 1168 return;
1179 1169
1180 if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || 1170 if (port->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
1181 !port->xmit_buf) 1171 !port->port.xmit_buf)
1182 return; 1172 return;
1183 1173
1184 spin_lock_irqsave(&riscom_lock, flags); 1174 spin_lock_irqsave(&riscom_lock, flags);
@@ -1317,19 +1307,19 @@ static int rc_set_serial_info(struct riscom_port *port,
1317 return -EINVAL; 1307 return -EINVAL;
1318#endif 1308#endif
1319 1309
1320 change_speed = ((port->flags & ASYNC_SPD_MASK) != 1310 change_speed = ((port->port.flags & ASYNC_SPD_MASK) !=
1321 (tmp.flags & ASYNC_SPD_MASK)); 1311 (tmp.flags & ASYNC_SPD_MASK));
1322 1312
1323 if (!capable(CAP_SYS_ADMIN)) { 1313 if (!capable(CAP_SYS_ADMIN)) {
1324 if ((tmp.close_delay != port->close_delay) || 1314 if ((tmp.close_delay != port->close_delay) ||
1325 (tmp.closing_wait != port->closing_wait) || 1315 (tmp.closing_wait != port->closing_wait) ||
1326 ((tmp.flags & ~ASYNC_USR_MASK) != 1316 ((tmp.flags & ~ASYNC_USR_MASK) !=
1327 (port->flags & ~ASYNC_USR_MASK))) 1317 (port->port.flags & ~ASYNC_USR_MASK)))
1328 return -EPERM; 1318 return -EPERM;
1329 port->flags = ((port->flags & ~ASYNC_USR_MASK) | 1319 port->port.flags = ((port->port.flags & ~ASYNC_USR_MASK) |
1330 (tmp.flags & ASYNC_USR_MASK)); 1320 (tmp.flags & ASYNC_USR_MASK));
1331 } else { 1321 } else {
1332 port->flags = ((port->flags & ~ASYNC_FLAGS) | 1322 port->port.flags = ((port->port.flags & ~ASYNC_FLAGS) |
1333 (tmp.flags & ASYNC_FLAGS)); 1323 (tmp.flags & ASYNC_FLAGS));
1334 port->close_delay = tmp.close_delay; 1324 port->close_delay = tmp.close_delay;
1335 port->closing_wait = tmp.closing_wait; 1325 port->closing_wait = tmp.closing_wait;
@@ -1355,7 +1345,7 @@ static int rc_get_serial_info(struct riscom_port *port,
1355 tmp.line = port - rc_port; 1345 tmp.line = port - rc_port;
1356 tmp.port = bp->base; 1346 tmp.port = bp->base;
1357 tmp.irq = bp->irq; 1347 tmp.irq = bp->irq;
1358 tmp.flags = port->flags; 1348 tmp.flags = port->port.flags;
1359 tmp.baud_base = (RC_OSCFREQ + CD180_TPC/2) / CD180_TPC; 1349 tmp.baud_base = (RC_OSCFREQ + CD180_TPC/2) / CD180_TPC;
1360 tmp.close_delay = port->close_delay * HZ/100; 1350 tmp.close_delay = port->close_delay * HZ/100;
1361 tmp.closing_wait = port->closing_wait * HZ/100; 1351 tmp.closing_wait = port->closing_wait * HZ/100;
@@ -1480,7 +1470,7 @@ static void rc_start(struct tty_struct *tty)
1480 1470
1481 spin_lock_irqsave(&riscom_lock, flags); 1471 spin_lock_irqsave(&riscom_lock, flags);
1482 1472
1483 if (port->xmit_cnt && port->xmit_buf && !(port->IER & IER_TXRDY)) { 1473 if (port->xmit_cnt && port->port.xmit_buf && !(port->IER & IER_TXRDY)) {
1484 port->IER |= IER_TXRDY; 1474 port->IER |= IER_TXRDY;
1485 rc_out(bp, CD180_CAR, port_No(port)); 1475 rc_out(bp, CD180_CAR, port_No(port));
1486 rc_out(bp, CD180_IER, port->IER); 1476 rc_out(bp, CD180_IER, port->IER);
@@ -1499,10 +1489,10 @@ static void rc_hangup(struct tty_struct *tty)
1499 bp = port_Board(port); 1489 bp = port_Board(port);
1500 1490
1501 rc_shutdown_port(bp, port); 1491 rc_shutdown_port(bp, port);
1502 port->count = 0; 1492 port->port.count = 0;
1503 port->flags &= ~ASYNC_NORMAL_ACTIVE; 1493 port->port.flags &= ~ASYNC_NORMAL_ACTIVE;
1504 port->tty = NULL; 1494 port->port.tty = NULL;
1505 wake_up_interruptible(&port->open_wait); 1495 wake_up_interruptible(&port->port.open_wait);
1506} 1496}
1507 1497
1508static void rc_set_termios(struct tty_struct *tty, 1498static void rc_set_termios(struct tty_struct *tty,
@@ -1578,8 +1568,7 @@ static int __init rc_init_drivers(void)
1578 rc_port[i].magic = RISCOM8_MAGIC; 1568 rc_port[i].magic = RISCOM8_MAGIC;
1579 rc_port[i].close_delay = 50 * HZ / 100; 1569 rc_port[i].close_delay = 50 * HZ / 100;
1580 rc_port[i].closing_wait = 3000 * HZ / 100; 1570 rc_port[i].closing_wait = 3000 * HZ / 100;
1581 init_waitqueue_head(&rc_port[i].open_wait); 1571 tty_port_init(&rc_port[i].port);
1582 init_waitqueue_head(&rc_port[i].close_wait);
1583 } 1572 }
1584 return 0; 1573 return 0;
1585} 1574}
diff --git a/drivers/char/riscom8.h b/drivers/char/riscom8.h
index cdfdf4394477..29ddbab78801 100644
--- a/drivers/char/riscom8.h
+++ b/drivers/char/riscom8.h
@@ -66,20 +66,14 @@ struct riscom_board {
66 66
67struct riscom_port { 67struct riscom_port {
68 int magic; 68 int magic;
69 struct tty_port port;
69 int baud_base; 70 int baud_base;
70 int flags;
71 struct tty_struct * tty;
72 int count;
73 int blocked_open;
74 int timeout; 71 int timeout;
75 int close_delay; 72 int close_delay;
76 unsigned char * xmit_buf;
77 int custom_divisor; 73 int custom_divisor;
78 int xmit_head; 74 int xmit_head;
79 int xmit_tail; 75 int xmit_tail;
80 int xmit_cnt; 76 int xmit_cnt;
81 wait_queue_head_t open_wait;
82 wait_queue_head_t close_wait;
83 short wakeup_chars; 77 short wakeup_chars;
84 short break_length; 78 short break_length;
85 unsigned short closing_wait; 79 unsigned short closing_wait;