aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-21 11:19:50 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-21 11:19:50 -0400
commiteb6a12c2428d21a9f3e0f1a50e927d5fd80fc3d0 (patch)
tree5ac6f43899648abeab1d43aad3107f664e7f13d5 /drivers/serial
parentc4762aba0b1f72659aae9ce37b772ca8bd8f06f4 (diff)
parent14b395e35d1afdd8019d11b92e28041fad591b71 (diff)
Merge branch 'linus' into cpus4096-for-linus
Conflicts: net/sunrpc/svc.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/21285.c12
-rw-r--r--drivers/serial/68328serial.c30
-rw-r--r--drivers/serial/68360serial.c52
-rw-r--r--drivers/serial/8250.c8
-rw-r--r--drivers/serial/8250.h2
-rw-r--r--drivers/serial/8250_pci.c2
-rw-r--r--drivers/serial/8250_pnp.c2
-rw-r--r--drivers/serial/Kconfig2
-rw-r--r--drivers/serial/Makefile2
-rw-r--r--drivers/serial/amba-pl010.c8
-rw-r--r--drivers/serial/amba-pl011.c4
-rw-r--r--drivers/serial/atmel_serial.c21
-rw-r--r--drivers/serial/bfin_5xx.c10
-rw-r--r--drivers/serial/bfin_sport_uart.c4
-rw-r--r--drivers/serial/clps711x.c9
-rw-r--r--drivers/serial/crisv10.c79
-rw-r--r--drivers/serial/dz.c4
-rw-r--r--drivers/serial/imx.c2
-rw-r--r--drivers/serial/ioc3_serial.c14
-rw-r--r--drivers/serial/ioc4_serial.c21
-rw-r--r--drivers/serial/ip22zilog.c4
-rw-r--r--drivers/serial/jsm/jsm_neo.c2
-rw-r--r--drivers/serial/jsm/jsm_tty.c8
-rw-r--r--drivers/serial/m32r_sio.c6
-rw-r--r--drivers/serial/mcf.c2
-rw-r--r--drivers/serial/mcfserial.c32
-rw-r--r--drivers/serial/mpc52xx_uart.c2
-rw-r--r--drivers/serial/mpsc.c6
-rw-r--r--drivers/serial/mux.c2
-rw-r--r--drivers/serial/netx-serial.c2
-rw-r--r--drivers/serial/pmac_zilog.c4
-rw-r--r--drivers/serial/pnx8xxx_uart.c4
-rw-r--r--drivers/serial/pxa.c2
-rw-r--r--drivers/serial/sa1100.c9
-rw-r--r--drivers/serial/sb1250-duart.c2
-rw-r--r--drivers/serial/sc26xx.c2
-rw-r--r--drivers/serial/serial_core.c82
-rw-r--r--drivers/serial/serial_ks8695.c2
-rw-r--r--drivers/serial/serial_lh7a40x.c2
-rw-r--r--drivers/serial/sh-sci.c8
-rw-r--r--drivers/serial/sn_console.c2
-rw-r--r--drivers/serial/sunhv.c2
-rw-r--r--drivers/serial/sunsab.c2
-rw-r--r--drivers/serial/sunsu.c4
-rw-r--r--drivers/serial/sunzilog.c4
-rw-r--r--drivers/serial/uartlite.c4
-rw-r--r--drivers/serial/ucc_uart.c2
-rw-r--r--drivers/serial/v850e_uart.c4
-rw-r--r--drivers/serial/vr41xx_siu.c2
-rw-r--r--drivers/serial/zs.c2
50 files changed, 250 insertions, 249 deletions
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c
index 0276471cb25e..6558a4037806 100644
--- a/drivers/serial/21285.c
+++ b/drivers/serial/21285.c
@@ -4,8 +4,6 @@
4 * Driver for the serial port on the 21285 StrongArm-110 core logic chip. 4 * Driver for the serial port on the 21285 StrongArm-110 core logic chip.
5 * 5 *
6 * Based on drivers/char/serial.c 6 * Based on drivers/char/serial.c
7 *
8 * $Id: 21285.c,v 1.37 2002/07/28 10:03:27 rmk Exp $
9 */ 7 */
10#include <linux/module.h> 8#include <linux/module.h>
11#include <linux/tty.h> 9#include <linux/tty.h>
@@ -88,7 +86,7 @@ static void serial21285_enable_ms(struct uart_port *port)
88static irqreturn_t serial21285_rx_chars(int irq, void *dev_id) 86static irqreturn_t serial21285_rx_chars(int irq, void *dev_id)
89{ 87{
90 struct uart_port *port = dev_id; 88 struct uart_port *port = dev_id;
91 struct tty_struct *tty = port->info->tty; 89 struct tty_struct *tty = port->info->port.tty;
92 unsigned int status, ch, flag, rxs, max_count = 256; 90 unsigned int status, ch, flag, rxs, max_count = 256;
93 91
94 status = *CSR_UARTFLG; 92 status = *CSR_UARTFLG;
@@ -237,8 +235,8 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios,
237 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); 235 baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
238 quot = uart_get_divisor(port, baud); 236 quot = uart_get_divisor(port, baud);
239 237
240 if (port->info && port->info->tty) { 238 if (port->info && port->info->port.tty) {
241 struct tty_struct *tty = port->info->tty; 239 struct tty_struct *tty = port->info->port.tty;
242 unsigned int b = port->uartclk / (16 * quot); 240 unsigned int b = port->uartclk / (16 * quot);
243 tty_encode_baud_rate(tty, b, b); 241 tty_encode_baud_rate(tty, b, b);
244 } 242 }
@@ -494,7 +492,7 @@ static int __init serial21285_init(void)
494{ 492{
495 int ret; 493 int ret;
496 494
497 printk(KERN_INFO "Serial: 21285 driver $Revision: 1.37 $\n"); 495 printk(KERN_INFO "Serial: 21285 driver\n");
498 496
499 serial21285_setup_ports(); 497 serial21285_setup_ports();
500 498
@@ -515,5 +513,5 @@ module_init(serial21285_init);
515module_exit(serial21285_exit); 513module_exit(serial21285_exit);
516 514
517MODULE_LICENSE("GPL"); 515MODULE_LICENSE("GPL");
518MODULE_DESCRIPTION("Intel Footbridge (21285) serial driver $Revision: 1.37 $"); 516MODULE_DESCRIPTION("Intel Footbridge (21285) serial driver");
519MODULE_ALIAS_CHARDEV(SERIAL_21285_MAJOR, SERIAL_21285_MINOR); 517MODULE_ALIAS_CHARDEV(SERIAL_21285_MAJOR, SERIAL_21285_MINOR);
diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c
index bbf5bc5892c7..381b12ac20e0 100644
--- a/drivers/serial/68328serial.c
+++ b/drivers/serial/68328serial.c
@@ -249,7 +249,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status)
249{ 249{
250#if 0 250#if 0
251 if(status & DCD) { 251 if(status & DCD) {
252 if((info->tty->termios->c_cflag & CRTSCTS) && 252 if((info->port.tty->termios->c_cflag & CRTSCTS) &&
253 ((info->curregs[3] & AUTO_ENAB)==0)) { 253 ((info->curregs[3] & AUTO_ENAB)==0)) {
254 info->curregs[3] |= AUTO_ENAB; 254 info->curregs[3] |= AUTO_ENAB;
255 info->pendregs[3] |= AUTO_ENAB; 255 info->pendregs[3] |= AUTO_ENAB;
@@ -274,7 +274,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status)
274 274
275static void receive_chars(struct m68k_serial *info, unsigned short rx) 275static void receive_chars(struct m68k_serial *info, unsigned short rx)
276{ 276{
277 struct tty_struct *tty = info->tty; 277 struct tty_struct *tty = info->port.tty;
278 m68328_uart *uart = &uart_addr[info->line]; 278 m68328_uart *uart = &uart_addr[info->line];
279 unsigned char ch, flag; 279 unsigned char ch, flag;
280 280
@@ -345,7 +345,7 @@ static void transmit_chars(struct m68k_serial *info)
345 goto clear_and_return; 345 goto clear_and_return;
346 } 346 }
347 347
348 if((info->xmit_cnt <= 0) || info->tty->stopped) { 348 if((info->xmit_cnt <= 0) || info->port.tty->stopped) {
349 /* That's peculiar... TX ints off */ 349 /* That's peculiar... TX ints off */
350 uart->ustcnt &= ~USTCNT_TX_INTR_MASK; 350 uart->ustcnt &= ~USTCNT_TX_INTR_MASK;
351 goto clear_and_return; 351 goto clear_and_return;
@@ -403,7 +403,7 @@ static void do_softint(struct work_struct *work)
403 struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); 403 struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue);
404 struct tty_struct *tty; 404 struct tty_struct *tty;
405 405
406 tty = info->tty; 406 tty = info->port.tty;
407 if (!tty) 407 if (!tty)
408 return; 408 return;
409#if 0 409#if 0
@@ -427,7 +427,7 @@ static void do_serial_hangup(struct work_struct *work)
427 struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); 427 struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup);
428 struct tty_struct *tty; 428 struct tty_struct *tty;
429 429
430 tty = info->tty; 430 tty = info->port.tty;
431 if (!tty) 431 if (!tty)
432 return; 432 return;
433 433
@@ -471,8 +471,8 @@ static int startup(struct m68k_serial * info)
471 uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK; 471 uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK;
472#endif 472#endif
473 473
474 if (info->tty) 474 if (info->port.tty)
475 clear_bit(TTY_IO_ERROR, &info->tty->flags); 475 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
476 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; 476 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
477 477
478 /* 478 /*
@@ -506,8 +506,8 @@ static void shutdown(struct m68k_serial * info)
506 info->xmit_buf = 0; 506 info->xmit_buf = 0;
507 } 507 }
508 508
509 if (info->tty) 509 if (info->port.tty)
510 set_bit(TTY_IO_ERROR, &info->tty->flags); 510 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
511 511
512 info->flags &= ~S_INITIALIZED; 512 info->flags &= ~S_INITIALIZED;
513 local_irq_restore(flags); 513 local_irq_restore(flags);
@@ -573,9 +573,9 @@ static void change_speed(struct m68k_serial *info)
573 unsigned cflag; 573 unsigned cflag;
574 int i; 574 int i;
575 575
576 if (!info->tty || !info->tty->termios) 576 if (!info->port.tty || !info->port.tty->termios)
577 return; 577 return;
578 cflag = info->tty->termios->c_cflag; 578 cflag = info->port.tty->termios->c_cflag;
579 if (!(port = info->port)) 579 if (!(port = info->port))
580 return; 580 return;
581 581
@@ -1131,7 +1131,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
1131 tty_ldisc_flush(tty); 1131 tty_ldisc_flush(tty);
1132 tty->closing = 0; 1132 tty->closing = 0;
1133 info->event = 0; 1133 info->event = 0;
1134 info->tty = 0; 1134 info->port.tty = NULL;
1135#warning "This is not and has never been valid so fix it" 1135#warning "This is not and has never been valid so fix it"
1136#if 0 1136#if 0
1137 if (tty->ldisc.num != ldiscs[N_TTY].num) { 1137 if (tty->ldisc.num != ldiscs[N_TTY].num) {
@@ -1169,7 +1169,7 @@ void rs_hangup(struct tty_struct *tty)
1169 info->event = 0; 1169 info->event = 0;
1170 info->count = 0; 1170 info->count = 0;
1171 info->flags &= ~S_NORMAL_ACTIVE; 1171 info->flags &= ~S_NORMAL_ACTIVE;
1172 info->tty = 0; 1172 info->port.tty = NULL;
1173 wake_up_interruptible(&info->open_wait); 1173 wake_up_interruptible(&info->open_wait);
1174} 1174}
1175 1175
@@ -1286,7 +1286,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
1286 1286
1287 info->count++; 1287 info->count++;
1288 tty->driver_data = info; 1288 tty->driver_data = info;
1289 info->tty = tty; 1289 info->port.tty = tty;
1290 1290
1291 /* 1291 /*
1292 * Start up serial port 1292 * Start up serial port
@@ -1363,7 +1363,7 @@ rs68328_init(void)
1363 info = &m68k_soft[i]; 1363 info = &m68k_soft[i];
1364 info->magic = SERIAL_MAGIC; 1364 info->magic = SERIAL_MAGIC;
1365 info->port = (int) &uart_addr[i]; 1365 info->port = (int) &uart_addr[i];
1366 info->tty = 0; 1366 info->port.tty = NULL;
1367 info->irq = uart_irqs[i]; 1367 info->irq = uart_irqs[i];
1368 info->custom_divisor = 16; 1368 info->custom_divisor = 16;
1369 info->close_delay = 50; 1369 info->close_delay = 50;
diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c
index d9d4e9552a4d..24661cd5e4fb 100644
--- a/drivers/serial/68360serial.c
+++ b/drivers/serial/68360serial.c
@@ -393,7 +393,7 @@ static void rs_360_start(struct tty_struct *tty)
393 393
394static _INLINE_ void receive_chars(ser_info_t *info) 394static _INLINE_ void receive_chars(ser_info_t *info)
395{ 395{
396 struct tty_struct *tty = info->tty; 396 struct tty_struct *tty = info->port.tty;
397 unsigned char ch, flag, *cp; 397 unsigned char ch, flag, *cp;
398 /*int ignored = 0;*/ 398 /*int ignored = 0;*/
399 int i; 399 int i;
@@ -514,7 +514,7 @@ static _INLINE_ void receive_chars(ser_info_t *info)
514 514
515static _INLINE_ void receive_break(ser_info_t *info) 515static _INLINE_ void receive_break(ser_info_t *info)
516{ 516{
517 struct tty_struct *tty = info->tty; 517 struct tty_struct *tty = info->port.tty;
518 518
519 info->state->icount.brk++; 519 info->state->icount.brk++;
520 /* Check to see if there is room in the tty buffer for 520 /* Check to see if there is room in the tty buffer for
@@ -528,7 +528,7 @@ static _INLINE_ void transmit_chars(ser_info_t *info)
528{ 528{
529 529
530 if ((info->flags & TX_WAKEUP) || 530 if ((info->flags & TX_WAKEUP) ||
531 (info->tty->flags & (1 << TTY_DO_WRITE_WAKEUP))) { 531 (info->port.tty->flags & (1 << TTY_DO_WRITE_WAKEUP))) {
532 schedule_work(&info->tqueue); 532 schedule_work(&info->tqueue);
533 } 533 }
534 534
@@ -584,12 +584,12 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
584 } 584 }
585 } 585 }
586 if (info->flags & ASYNC_CTS_FLOW) { 586 if (info->flags & ASYNC_CTS_FLOW) {
587 if (info->tty->hw_stopped) { 587 if (info->port.tty->hw_stopped) {
588 if (status & UART_MSR_CTS) { 588 if (status & UART_MSR_CTS) {
589#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) 589#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
590 printk("CTS tx start..."); 590 printk("CTS tx start...");
591#endif 591#endif
592 info->tty->hw_stopped = 0; 592 info->port.tty->hw_stopped = 0;
593 info->IER |= UART_IER_THRI; 593 info->IER |= UART_IER_THRI;
594 serial_out(info, UART_IER, info->IER); 594 serial_out(info, UART_IER, info->IER);
595 rs_sched_event(info, RS_EVENT_WRITE_WAKEUP); 595 rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
@@ -600,7 +600,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
600#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) 600#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
601 printk("CTS tx stop..."); 601 printk("CTS tx stop...");
602#endif 602#endif
603 info->tty->hw_stopped = 1; 603 info->port.tty->hw_stopped = 1;
604 info->IER &= ~UART_IER_THRI; 604 info->IER &= ~UART_IER_THRI;
605 serial_out(info, UART_IER, info->IER); 605 serial_out(info, UART_IER, info->IER);
606 } 606 }
@@ -670,7 +670,7 @@ static void do_softint(void *private_)
670 ser_info_t *info = (ser_info_t *) private_; 670 ser_info_t *info = (ser_info_t *) private_;
671 struct tty_struct *tty; 671 struct tty_struct *tty;
672 672
673 tty = info->tty; 673 tty = info->port.tty;
674 if (!tty) 674 if (!tty)
675 return; 675 return;
676 676
@@ -693,7 +693,7 @@ static void do_serial_hangup(void *private_)
693 struct async_struct *info = (struct async_struct *) private_; 693 struct async_struct *info = (struct async_struct *) private_;
694 struct tty_struct *tty; 694 struct tty_struct *tty;
695 695
696 tty = info->tty; 696 tty = info->port.tty;
697 if (!tty) 697 if (!tty)
698 return; 698 return;
699 699
@@ -721,8 +721,8 @@ static int startup(ser_info_t *info)
721 721
722#ifdef maybe 722#ifdef maybe
723 if (!state->port || !state->type) { 723 if (!state->port || !state->type) {
724 if (info->tty) 724 if (info->port.tty)
725 set_bit(TTY_IO_ERROR, &info->tty->flags); 725 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
726 goto errout; 726 goto errout;
727 } 727 }
728#endif 728#endif
@@ -734,12 +734,12 @@ static int startup(ser_info_t *info)
734 734
735#ifdef modem_control 735#ifdef modem_control
736 info->MCR = 0; 736 info->MCR = 0;
737 if (info->tty->termios->c_cflag & CBAUD) 737 if (info->port.tty->termios->c_cflag & CBAUD)
738 info->MCR = UART_MCR_DTR | UART_MCR_RTS; 738 info->MCR = UART_MCR_DTR | UART_MCR_RTS;
739#endif 739#endif
740 740
741 if (info->tty) 741 if (info->port.tty)
742 clear_bit(TTY_IO_ERROR, &info->tty->flags); 742 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
743 743
744 /* 744 /*
745 * and set the speed of the serial port 745 * and set the speed of the serial port
@@ -842,8 +842,8 @@ static void shutdown(ser_info_t *info)
842 smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); 842 smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
843 } 843 }
844 844
845 if (info->tty) 845 if (info->port.tty)
846 set_bit(TTY_IO_ERROR, &info->tty->flags); 846 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
847 847
848 info->flags &= ~ASYNC_INITIALIZED; 848 info->flags &= ~ASYNC_INITIALIZED;
849 local_irq_restore(flags); 849 local_irq_restore(flags);
@@ -863,9 +863,9 @@ static void change_speed(ser_info_t *info)
863 volatile struct smc_regs *smcp; 863 volatile struct smc_regs *smcp;
864 volatile struct scc_regs *sccp; 864 volatile struct scc_regs *sccp;
865 865
866 if (!info->tty || !info->tty->termios) 866 if (!info->port.tty || !info->port.tty->termios)
867 return; 867 return;
868 cflag = info->tty->termios->c_cflag; 868 cflag = info->port.tty->termios->c_cflag;
869 869
870 state = info->state; 870 state = info->state;
871 871
@@ -936,24 +936,24 @@ static void change_speed(ser_info_t *info)
936 * Set up parity check flag 936 * Set up parity check flag
937 */ 937 */
938 info->read_status_mask = (BD_SC_EMPTY | BD_SC_OV); 938 info->read_status_mask = (BD_SC_EMPTY | BD_SC_OV);
939 if (I_INPCK(info->tty)) 939 if (I_INPCK(info->port.tty))
940 info->read_status_mask |= BD_SC_FR | BD_SC_PR; 940 info->read_status_mask |= BD_SC_FR | BD_SC_PR;
941 if (I_BRKINT(info->tty) || I_PARMRK(info->tty)) 941 if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty))
942 info->read_status_mask |= BD_SC_BR; 942 info->read_status_mask |= BD_SC_BR;
943 943
944 /* 944 /*
945 * Characters to ignore 945 * Characters to ignore
946 */ 946 */
947 info->ignore_status_mask = 0; 947 info->ignore_status_mask = 0;
948 if (I_IGNPAR(info->tty)) 948 if (I_IGNPAR(info->port.tty))
949 info->ignore_status_mask |= BD_SC_PR | BD_SC_FR; 949 info->ignore_status_mask |= BD_SC_PR | BD_SC_FR;
950 if (I_IGNBRK(info->tty)) { 950 if (I_IGNBRK(info->port.tty)) {
951 info->ignore_status_mask |= BD_SC_BR; 951 info->ignore_status_mask |= BD_SC_BR;
952 /* 952 /*
953 * If we're ignore parity and break indicators, ignore 953 * If we're ignore parity and break indicators, ignore
954 * overruns too. (For real raw support). 954 * overruns too. (For real raw support).
955 */ 955 */
956 if (I_IGNPAR(info->tty)) 956 if (I_IGNPAR(info->port.tty))
957 info->ignore_status_mask |= BD_SC_OV; 957 info->ignore_status_mask |= BD_SC_OV;
958 } 958 }
959 /* 959 /*
@@ -1658,7 +1658,7 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
1658 tty_ldisc_flush(tty); 1658 tty_ldisc_flush(tty);
1659 tty->closing = 0; 1659 tty->closing = 0;
1660 info->event = 0; 1660 info->event = 0;
1661 info->tty = 0; 1661 info->port.tty = NULL;
1662 if (info->blocked_open) { 1662 if (info->blocked_open) {
1663 if (info->close_delay) { 1663 if (info->close_delay) {
1664 msleep_interruptible(jiffies_to_msecs(info->close_delay)); 1664 msleep_interruptible(jiffies_to_msecs(info->close_delay));
@@ -1758,7 +1758,7 @@ static void rs_360_hangup(struct tty_struct *tty)
1758 info->event = 0; 1758 info->event = 0;
1759 state->count = 0; 1759 state->count = 0;
1760 info->flags &= ~ASYNC_NORMAL_ACTIVE; 1760 info->flags &= ~ASYNC_NORMAL_ACTIVE;
1761 info->tty = 0; 1761 info->port.tty = NULL;
1762 wake_up_interruptible(&info->open_wait); 1762 wake_up_interruptible(&info->open_wait);
1763} 1763}
1764 1764
@@ -1919,7 +1919,7 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp)
1919 printk("rs_open %s, count = %d\n", tty->name, info->state->count); 1919 printk("rs_open %s, count = %d\n", tty->name, info->state->count);
1920#endif 1920#endif
1921 tty->driver_data = info; 1921 tty->driver_data = info;
1922 info->tty = tty; 1922 info->port.tty = tty;
1923 1923
1924 /* 1924 /*
1925 * Start up serial port 1925 * Start up serial port
@@ -1976,7 +1976,7 @@ static inline int line_info(char *buf, struct serial_state *state)
1976 info->port = state->port; 1976 info->port = state->port;
1977 info->flags = state->flags; 1977 info->flags = state->flags;
1978 info->quot = 0; 1978 info->quot = 0;
1979 info->tty = 0; 1979 info->port.tty = NULL;
1980 } 1980 }
1981 local_irq_disable(); 1981 local_irq_disable();
1982 status = serial_in(info, UART_MSR); 1982 status = serial_in(info, UART_MSR);
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index be95e55b228b..ce948b66bbd4 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -12,8 +12,6 @@
12 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. 13 * (at your option) any later version.
14 * 14 *
15 * $Id: 8250.c,v 1.90 2002/07/28 10:03:27 rmk Exp $
16 *
17 * A note about mapbase / membase 15 * A note about mapbase / membase
18 * 16 *
19 * mapbase is the physical address of the IO port. 17 * mapbase is the physical address of the IO port.
@@ -1289,7 +1287,7 @@ static void serial8250_enable_ms(struct uart_port *port)
1289static void 1287static void
1290receive_chars(struct uart_8250_port *up, unsigned int *status) 1288receive_chars(struct uart_8250_port *up, unsigned int *status)
1291{ 1289{
1292 struct tty_struct *tty = up->port.info->tty; 1290 struct tty_struct *tty = up->port.info->port.tty;
1293 unsigned char ch, lsr = *status; 1291 unsigned char ch, lsr = *status;
1294 int max_count = 256; 1292 int max_count = 256;
1295 char flag; 1293 char flag;
@@ -2934,7 +2932,7 @@ static int __init serial8250_init(void)
2934 if (nr_uarts > UART_NR) 2932 if (nr_uarts > UART_NR)
2935 nr_uarts = UART_NR; 2933 nr_uarts = UART_NR;
2936 2934
2937 printk(KERN_INFO "Serial: 8250/16550 driver $Revision: 1.90 $ " 2935 printk(KERN_INFO "Serial: 8250/16550 driver"
2938 "%d ports, IRQ sharing %sabled\n", nr_uarts, 2936 "%d ports, IRQ sharing %sabled\n", nr_uarts,
2939 share_irqs ? "en" : "dis"); 2937 share_irqs ? "en" : "dis");
2940 2938
@@ -2995,7 +2993,7 @@ EXPORT_SYMBOL(serial8250_suspend_port);
2995EXPORT_SYMBOL(serial8250_resume_port); 2993EXPORT_SYMBOL(serial8250_resume_port);
2996 2994
2997MODULE_LICENSE("GPL"); 2995MODULE_LICENSE("GPL");
2998MODULE_DESCRIPTION("Generic 8250/16x50 serial driver $Revision: 1.90 $"); 2996MODULE_DESCRIPTION("Generic 8250/16x50 serial driver");
2999 2997
3000module_param(share_irqs, uint, 0644); 2998module_param(share_irqs, uint, 0644);
3001MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices" 2999MODULE_PARM_DESC(share_irqs, "Share IRQs with other non-8250/16x50 devices"
diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h
index 91bd28f2bb47..78c00162b04e 100644
--- a/drivers/serial/8250.h
+++ b/drivers/serial/8250.h
@@ -11,8 +11,6 @@
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or 12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. 13 * (at your option) any later version.
14 *
15 * $Id: 8250.h,v 1.8 2002/07/21 21:32:30 rmk Exp $
16 */ 14 */
17 15
18#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index 788c3559522d..1b36087665a2 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -10,8 +10,6 @@
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License. 12 * the Free Software Foundation; either version 2 of the License.
13 *
14 * $Id: 8250_pci.c,v 1.28 2002/11/02 11:14:18 rmk Exp $
15 */ 13 */
16#include <linux/module.h> 14#include <linux/module.h>
17#include <linux/init.h> 15#include <linux/init.h>
diff --git a/drivers/serial/8250_pnp.c b/drivers/serial/8250_pnp.c
index 638b68649e79..fde7f9ccf57e 100644
--- a/drivers/serial/8250_pnp.c
+++ b/drivers/serial/8250_pnp.c
@@ -12,8 +12,6 @@
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by 13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License. 14 * the Free Software Foundation; either version 2 of the License.
15 *
16 * $Id: 8250_pnp.c,v 1.10 2002/07/21 21:32:30 rmk Exp $
17 */ 15 */
18#include <linux/module.h> 16#include <linux/module.h>
19#include <linux/init.h> 17#include <linux/init.h>
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 18ca9075e131..8fc7451c0049 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -1,8 +1,6 @@
1# 1#
2# Serial device configuration 2# Serial device configuration
3# 3#
4# $Id: Kconfig,v 1.11 2004/03/11 18:08:04 lethal Exp $
5#
6 4
7menu "Serial drivers" 5menu "Serial drivers"
8 depends on HAS_IOMEM 6 depends on HAS_IOMEM
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 7d85c1fbe7e0..3a0bbbe17aa3 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -1,8 +1,6 @@
1# 1#
2# Makefile for the kernel serial device drivers. 2# Makefile for the kernel serial device drivers.
3# 3#
4# $Id: Makefile,v 1.8 2002/07/21 21:32:30 rmk Exp $
5#
6 4
7obj-$(CONFIG_SERIAL_CORE) += serial_core.o 5obj-$(CONFIG_SERIAL_CORE) += serial_core.o
8obj-$(CONFIG_SERIAL_21285) += 21285.o 6obj-$(CONFIG_SERIAL_21285) += 21285.o
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index e88da72f8304..90b56c2c31e2 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -22,8 +22,6 @@
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * 24 *
25 * $Id: amba.c,v 1.41 2002/07/28 10:03:27 rmk Exp $
26 *
27 * This is a generic driver for ARM AMBA-type serial ports. They 25 * This is a generic driver for ARM AMBA-type serial ports. They
28 * have a lot of 16550-like features, but are not register compatible. 26 * have a lot of 16550-like features, but are not register compatible.
29 * Note that although they do have CTS, DCD and DSR inputs, they do 27 * Note that although they do have CTS, DCD and DSR inputs, they do
@@ -119,7 +117,7 @@ static void pl010_enable_ms(struct uart_port *port)
119 117
120static void pl010_rx_chars(struct uart_amba_port *uap) 118static void pl010_rx_chars(struct uart_amba_port *uap)
121{ 119{
122 struct tty_struct *tty = uap->port.info->tty; 120 struct tty_struct *tty = uap->port.info->port.tty;
123 unsigned int status, ch, flag, rsr, max_count = 256; 121 unsigned int status, ch, flag, rsr, max_count = 256;
124 122
125 status = readb(uap->port.membase + UART01x_FR); 123 status = readb(uap->port.membase + UART01x_FR);
@@ -791,7 +789,7 @@ static int __init pl010_init(void)
791{ 789{
792 int ret; 790 int ret;
793 791
794 printk(KERN_INFO "Serial: AMBA driver $Revision: 1.41 $\n"); 792 printk(KERN_INFO "Serial: AMBA driver\n");
795 793
796 ret = uart_register_driver(&amba_reg); 794 ret = uart_register_driver(&amba_reg);
797 if (ret == 0) { 795 if (ret == 0) {
@@ -812,5 +810,5 @@ module_init(pl010_init);
812module_exit(pl010_exit); 810module_exit(pl010_exit);
813 811
814MODULE_AUTHOR("ARM Ltd/Deep Blue Solutions Ltd"); 812MODULE_AUTHOR("ARM Ltd/Deep Blue Solutions Ltd");
815MODULE_DESCRIPTION("ARM AMBA serial port driver $Revision: 1.41 $"); 813MODULE_DESCRIPTION("ARM AMBA serial port driver");
816MODULE_LICENSE("GPL"); 814MODULE_LICENSE("GPL");
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 08adc1de4a79..9d08f27208a1 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -22,8 +22,6 @@
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * 24 *
25 * $Id: amba.c,v 1.41 2002/07/28 10:03:27 rmk Exp $
26 *
27 * This is a generic driver for ARM AMBA-type serial ports. They 25 * This is a generic driver for ARM AMBA-type serial ports. They
28 * have a lot of 16550-like features, but are not register compatible. 26 * have a lot of 16550-like features, but are not register compatible.
29 * Note that although they do have CTS, DCD and DSR inputs, they do 27 * Note that although they do have CTS, DCD and DSR inputs, they do
@@ -109,7 +107,7 @@ static void pl011_enable_ms(struct uart_port *port)
109 107
110static void pl011_rx_chars(struct uart_amba_port *uap) 108static void pl011_rx_chars(struct uart_amba_port *uap)
111{ 109{
112 struct tty_struct *tty = uap->port.info->tty; 110 struct tty_struct *tty = uap->port.info->port.tty;
113 unsigned int status, ch, flag, max_count = 256; 111 unsigned int status, ch, flag, max_count = 256;
114 112
115 status = readw(uap->port.membase + UART01x_FR); 113 status = readw(uap->port.membase + UART01x_FR);
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index 6aeef22bd203..1fee12c1f4f8 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -662,14 +662,14 @@ static void atmel_rx_from_ring(struct uart_port *port)
662 * uart_start(), which takes the lock. 662 * uart_start(), which takes the lock.
663 */ 663 */
664 spin_unlock(&port->lock); 664 spin_unlock(&port->lock);
665 tty_flip_buffer_push(port->info->tty); 665 tty_flip_buffer_push(port->info->port.tty);
666 spin_lock(&port->lock); 666 spin_lock(&port->lock);
667} 667}
668 668
669static void atmel_rx_from_dma(struct uart_port *port) 669static void atmel_rx_from_dma(struct uart_port *port)
670{ 670{
671 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 671 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
672 struct tty_struct *tty = port->info->tty; 672 struct tty_struct *tty = port->info->port.tty;
673 struct atmel_dma_buffer *pdc; 673 struct atmel_dma_buffer *pdc;
674 int rx_idx = atmel_port->pdc_rx_idx; 674 int rx_idx = atmel_port->pdc_rx_idx;
675 unsigned int head; 675 unsigned int head;
@@ -794,7 +794,7 @@ static void atmel_tasklet_func(unsigned long data)
794static int atmel_startup(struct uart_port *port) 794static int atmel_startup(struct uart_port *port)
795{ 795{
796 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port); 796 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
797 struct tty_struct *tty = port->info->tty; 797 struct tty_struct *tty = port->info->port.tty;
798 int retval; 798 int retval;
799 799
800 /* 800 /*
@@ -956,6 +956,20 @@ static void atmel_shutdown(struct uart_port *port)
956} 956}
957 957
958/* 958/*
959 * Flush any TX data submitted for DMA. Called when the TX circular
960 * buffer is reset.
961 */
962static void atmel_flush_buffer(struct uart_port *port)
963{
964 struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
965
966 if (atmel_use_dma_tx(port)) {
967 UART_PUT_TCR(port, 0);
968 atmel_port->pdc_tx.ofs = 0;
969 }
970}
971
972/*
959 * Power / Clock management. 973 * Power / Clock management.
960 */ 974 */
961static void atmel_serial_pm(struct uart_port *port, unsigned int state, 975static void atmel_serial_pm(struct uart_port *port, unsigned int state,
@@ -1189,6 +1203,7 @@ static struct uart_ops atmel_pops = {
1189 .break_ctl = atmel_break_ctl, 1203 .break_ctl = atmel_break_ctl,
1190 .startup = atmel_startup, 1204 .startup = atmel_startup,
1191 .shutdown = atmel_shutdown, 1205 .shutdown = atmel_shutdown,
1206 .flush_buffer = atmel_flush_buffer,
1192 .set_termios = atmel_set_termios, 1207 .set_termios = atmel_set_termios,
1193 .type = atmel_type, 1208 .type = atmel_type,
1194 .release_port = atmel_release_port, 1209 .release_port = atmel_release_port,
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index fd9bb777df28..9d8543762a30 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -175,7 +175,7 @@ int kgdb_get_debug_char(void)
175#ifdef CONFIG_SERIAL_BFIN_PIO 175#ifdef CONFIG_SERIAL_BFIN_PIO
176static void bfin_serial_rx_chars(struct bfin_serial_port *uart) 176static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
177{ 177{
178 struct tty_struct *tty = uart->port.info->tty; 178 struct tty_struct *tty = uart->port.info->port.tty;
179 unsigned int status, ch, flg; 179 unsigned int status, ch, flg;
180 static struct timeval anomaly_start = { .tv_sec = 0 }; 180 static struct timeval anomaly_start = { .tv_sec = 0 };
181 181
@@ -393,7 +393,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
393 393
394static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) 394static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
395{ 395{
396 struct tty_struct *tty = uart->port.info->tty; 396 struct tty_struct *tty = uart->port.info->port.tty;
397 int i, flg, status; 397 int i, flg, status;
398 398
399 status = UART_GET_LSR(uart); 399 status = UART_GET_LSR(uart);
@@ -552,7 +552,7 @@ static void bfin_serial_mctrl_check(struct bfin_serial_port *uart)
552#ifdef CONFIG_SERIAL_BFIN_CTSRTS 552#ifdef CONFIG_SERIAL_BFIN_CTSRTS
553 unsigned int status; 553 unsigned int status;
554 struct uart_info *info = uart->port.info; 554 struct uart_info *info = uart->port.info;
555 struct tty_struct *tty = info->tty; 555 struct tty_struct *tty = info->port.tty;
556 556
557 status = bfin_serial_get_mctrl(&uart->port); 557 status = bfin_serial_get_mctrl(&uart->port);
558 uart_handle_cts_change(&uart->port, status & TIOCM_CTS); 558 uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
@@ -814,10 +814,10 @@ static void bfin_serial_set_ldisc(struct uart_port *port)
814 int line = port->line; 814 int line = port->line;
815 unsigned short val; 815 unsigned short val;
816 816
817 if (line >= port->info->tty->driver->num) 817 if (line >= port->info->port.tty->driver->num)
818 return; 818 return;
819 819
820 switch (port->info->tty->ldisc.num) { 820 switch (port->info->port.tty->ldisc.num) {
821 case N_IRDA: 821 case N_IRDA:
822 val = UART_GET_GCTL(&bfin_serial_ports[line]); 822 val = UART_GET_GCTL(&bfin_serial_ports[line]);
823 val |= (IREN | RPOLC); 823 val |= (IREN | RPOLC);
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c
index aca1240ad808..dd8564d25051 100644
--- a/drivers/serial/bfin_sport_uart.c
+++ b/drivers/serial/bfin_sport_uart.c
@@ -174,7 +174,7 @@ static int sport_uart_setup(struct sport_uart_port *up, int sclk, int baud_rate)
174static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id) 174static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id)
175{ 175{
176 struct sport_uart_port *up = dev_id; 176 struct sport_uart_port *up = dev_id;
177 struct tty_struct *tty = up->port.info->tty; 177 struct tty_struct *tty = up->port.info->port.tty;
178 unsigned int ch; 178 unsigned int ch;
179 179
180 do { 180 do {
@@ -201,7 +201,7 @@ static irqreturn_t sport_uart_tx_irq(int irq, void *dev_id)
201static irqreturn_t sport_uart_err_irq(int irq, void *dev_id) 201static irqreturn_t sport_uart_err_irq(int irq, void *dev_id)
202{ 202{
203 struct sport_uart_port *up = dev_id; 203 struct sport_uart_port *up = dev_id;
204 struct tty_struct *tty = up->port.info->tty; 204 struct tty_struct *tty = up->port.info->port.tty;
205 unsigned int stat = SPORT_GET_STAT(up); 205 unsigned int stat = SPORT_GET_STAT(up);
206 206
207 /* Overflow in RX FIFO */ 207 /* Overflow in RX FIFO */
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c
index 23827189ec0e..fc1fa9267c59 100644
--- a/drivers/serial/clps711x.c
+++ b/drivers/serial/clps711x.c
@@ -21,9 +21,6 @@
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software 22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 * $Id: clps711x.c,v 1.42 2002/07/28 10:03:28 rmk Exp $
26 *
27 */ 24 */
28 25
29#if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 26#if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
@@ -96,7 +93,7 @@ static void clps711xuart_enable_ms(struct uart_port *port)
96static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id) 93static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id)
97{ 94{
98 struct uart_port *port = dev_id; 95 struct uart_port *port = dev_id;
99 struct tty_struct *tty = port->info->tty; 96 struct tty_struct *tty = port->info->port.tty;
100 unsigned int status, ch, flg; 97 unsigned int status, ch, flg;
101 98
102 status = clps_readl(SYSFLG(port)); 99 status = clps_readl(SYSFLG(port));
@@ -551,7 +548,7 @@ static int __init clps711xuart_init(void)
551{ 548{
552 int ret, i; 549 int ret, i;
553 550
554 printk(KERN_INFO "Serial: CLPS711x driver $Revision: 1.42 $\n"); 551 printk(KERN_INFO "Serial: CLPS711x driver\n");
555 552
556 ret = uart_register_driver(&clps711x_reg); 553 ret = uart_register_driver(&clps711x_reg);
557 if (ret) 554 if (ret)
@@ -577,6 +574,6 @@ module_init(clps711xuart_init);
577module_exit(clps711xuart_exit); 574module_exit(clps711xuart_exit);
578 575
579MODULE_AUTHOR("Deep Blue Solutions Ltd"); 576MODULE_AUTHOR("Deep Blue Solutions Ltd");
580MODULE_DESCRIPTION("CLPS-711x generic serial driver $Revision: 1.42 $"); 577MODULE_DESCRIPTION("CLPS-711x generic serial driver");
581MODULE_LICENSE("GPL"); 578MODULE_LICENSE("GPL");
582MODULE_ALIAS_CHARDEV(SERIAL_CLPS711X_MAJOR, SERIAL_CLPS711X_MINOR); 579MODULE_ALIAS_CHARDEV(SERIAL_CLPS711X_MAJOR, SERIAL_CLPS711X_MINOR);
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c
index 3e0366eab412..8249ac490559 100644
--- a/drivers/serial/crisv10.c
+++ b/drivers/serial/crisv10.c
@@ -968,7 +968,7 @@ static DEFINE_MUTEX(tmp_buf_mutex);
968/* Calculate the chartime depending on baudrate, numbor of bits etc. */ 968/* Calculate the chartime depending on baudrate, numbor of bits etc. */
969static void update_char_time(struct e100_serial * info) 969static void update_char_time(struct e100_serial * info)
970{ 970{
971 tcflag_t cflags = info->tty->termios->c_cflag; 971 tcflag_t cflags = info->port.tty->termios->c_cflag;
972 int bits; 972 int bits;
973 973
974 /* calc. number of bits / data byte */ 974 /* calc. number of bits / data byte */
@@ -1483,7 +1483,8 @@ rs_stop(struct tty_struct *tty)
1483 CIRC_CNT(info->xmit.head, 1483 CIRC_CNT(info->xmit.head,
1484 info->xmit.tail,SERIAL_XMIT_SIZE))); 1484 info->xmit.tail,SERIAL_XMIT_SIZE)));
1485 1485
1486 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->tty)); 1486 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char,
1487 STOP_CHAR(info->port.tty));
1487 xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, stop); 1488 xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, stop);
1488 if (tty->termios->c_iflag & IXON ) { 1489 if (tty->termios->c_iflag & IXON ) {
1489 xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); 1490 xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
@@ -1772,7 +1773,7 @@ add_char_and_flag(struct e100_serial *info, unsigned char data, unsigned char fl
1772 1773
1773 info->icount.rx++; 1774 info->icount.rx++;
1774 } else { 1775 } else {
1775 struct tty_struct *tty = info->tty; 1776 struct tty_struct *tty = info->port.tty;
1776 tty_insert_flip_char(tty, data, flag); 1777 tty_insert_flip_char(tty, data, flag);
1777 info->icount.rx++; 1778 info->icount.rx++;
1778 } 1779 }
@@ -1838,7 +1839,7 @@ static unsigned int handle_all_descr_data(struct e100_serial *info)
1838 descr->status = 0; 1839 descr->status = 0;
1839 1840
1840 DFLOW( DEBUG_LOG(info->line, "RX %lu\n", recvl); 1841 DFLOW( DEBUG_LOG(info->line, "RX %lu\n", recvl);
1841 if (info->tty->stopped) { 1842 if (info->port.tty->stopped) {
1842 unsigned char *buf = phys_to_virt(descr->buf); 1843 unsigned char *buf = phys_to_virt(descr->buf);
1843 DEBUG_LOG(info->line, "rx 0x%02X\n", buf[0]); 1844 DEBUG_LOG(info->line, "rx 0x%02X\n", buf[0]);
1844 DEBUG_LOG(info->line, "rx 0x%02X\n", buf[1]); 1845 DEBUG_LOG(info->line, "rx 0x%02X\n", buf[1]);
@@ -1872,7 +1873,7 @@ static void receive_chars_dma(struct e100_serial *info)
1872 IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) | 1873 IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |
1873 IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do); 1874 IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do);
1874 1875
1875 tty = info->tty; 1876 tty = info->port.tty;
1876 if (!tty) /* Something wrong... */ 1877 if (!tty) /* Something wrong... */
1877 return; 1878 return;
1878 1879
@@ -2122,7 +2123,7 @@ static void flush_to_flip_buffer(struct e100_serial *info)
2122 unsigned long flags; 2123 unsigned long flags;
2123 2124
2124 local_irq_save(flags); 2125 local_irq_save(flags);
2125 tty = info->tty; 2126 tty = info->port.tty;
2126 2127
2127 if (!tty) { 2128 if (!tty) {
2128 local_irq_restore(flags); 2129 local_irq_restore(flags);
@@ -2287,7 +2288,7 @@ static
2287struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info) 2288struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info)
2288{ 2289{
2289 unsigned long data_read; 2290 unsigned long data_read;
2290 struct tty_struct *tty = info->tty; 2291 struct tty_struct *tty = info->port.tty;
2291 2292
2292 if (!tty) { 2293 if (!tty) {
2293 printk("!NO TTY!\n"); 2294 printk("!NO TTY!\n");
@@ -2350,7 +2351,7 @@ more_data:
2350 data_in, data_read); 2351 data_in, data_read);
2351 char flag = TTY_NORMAL; 2352 char flag = TTY_NORMAL;
2352 if (info->errorcode == ERRCODE_INSERT_BREAK) { 2353 if (info->errorcode == ERRCODE_INSERT_BREAK) {
2353 struct tty_struct *tty = info->tty; 2354 struct tty_struct *tty = info->port.tty;
2354 tty_insert_flip_char(tty, 0, flag); 2355 tty_insert_flip_char(tty, 0, flag);
2355 info->icount.rx++; 2356 info->icount.rx++;
2356 } 2357 }
@@ -2396,7 +2397,7 @@ more_data:
2396 goto more_data; 2397 goto more_data;
2397 } 2398 }
2398 2399
2399 tty_flip_buffer_push(info->tty); 2400 tty_flip_buffer_push(info->port.tty);
2400 return info; 2401 return info;
2401} 2402}
2402 2403
@@ -2547,8 +2548,8 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
2547 rstat = info->port[REG_STATUS]; 2548 rstat = info->port[REG_STATUS];
2548 DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat)); 2549 DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
2549 e100_disable_serial_tx_ready_irq(info); 2550 e100_disable_serial_tx_ready_irq(info);
2550 if (info->tty->stopped) 2551 if (info->port.tty->stopped)
2551 rs_stop(info->tty); 2552 rs_stop(info->port.tty);
2552 /* Enable the DMA channel and tell it to continue */ 2553 /* Enable the DMA channel and tell it to continue */
2553 e100_enable_txdma_channel(info); 2554 e100_enable_txdma_channel(info);
2554 /* Wait 12 cycles before doing the DMA command */ 2555 /* Wait 12 cycles before doing the DMA command */
@@ -2561,9 +2562,10 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
2561 } 2562 }
2562 /* Normal char-by-char interrupt */ 2563 /* Normal char-by-char interrupt */
2563 if (info->xmit.head == info->xmit.tail 2564 if (info->xmit.head == info->xmit.tail
2564 || info->tty->stopped 2565 || info->port.tty->stopped
2565 || info->tty->hw_stopped) { 2566 || info->port.tty->hw_stopped) {
2566 DFLOW(DEBUG_LOG(info->line, "tx_int: stopped %i\n", info->tty->stopped)); 2567 DFLOW(DEBUG_LOG(info->line, "tx_int: stopped %i\n",
2568 info->port.tty->stopped));
2567 e100_disable_serial_tx_ready_irq(info); 2569 e100_disable_serial_tx_ready_irq(info);
2568 info->tr_running = 0; 2570 info->tr_running = 0;
2569 return; 2571 return;
@@ -2725,7 +2727,7 @@ do_softint(struct work_struct *work)
2725 2727
2726 info = container_of(work, struct e100_serial, work); 2728 info = container_of(work, struct e100_serial, work);
2727 2729
2728 tty = info->tty; 2730 tty = info->port.tty;
2729 if (!tty) 2731 if (!tty)
2730 return; 2732 return;
2731 2733
@@ -2767,8 +2769,8 @@ startup(struct e100_serial * info)
2767 /* Bits and pieces collected from below. Better to have them 2769 /* Bits and pieces collected from below. Better to have them
2768 in one ifdef:ed clause than to mix in a lot of ifdefs, 2770 in one ifdef:ed clause than to mix in a lot of ifdefs,
2769 right? */ 2771 right? */
2770 if (info->tty) 2772 if (info->port.tty)
2771 clear_bit(TTY_IO_ERROR, &info->tty->flags); 2773 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
2772 2774
2773 info->xmit.head = info->xmit.tail = 0; 2775 info->xmit.head = info->xmit.tail = 0;
2774 info->first_recv_buffer = info->last_recv_buffer = NULL; 2776 info->first_recv_buffer = info->last_recv_buffer = NULL;
@@ -2825,8 +2827,8 @@ startup(struct e100_serial * info)
2825 e100_disable_txdma_channel(info); 2827 e100_disable_txdma_channel(info);
2826 } 2828 }
2827 2829
2828 if (info->tty) 2830 if (info->port.tty)
2829 clear_bit(TTY_IO_ERROR, &info->tty->flags); 2831 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
2830 2832
2831 info->xmit.head = info->xmit.tail = 0; 2833 info->xmit.head = info->xmit.tail = 0;
2832 info->first_recv_buffer = info->last_recv_buffer = NULL; 2834 info->first_recv_buffer = info->last_recv_buffer = NULL;
@@ -2940,14 +2942,14 @@ shutdown(struct e100_serial * info)
2940 descr[i].buf = 0; 2942 descr[i].buf = 0;
2941 } 2943 }
2942 2944
2943 if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) { 2945 if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) {
2944 /* hang up DTR and RTS if HUPCL is enabled */ 2946 /* hang up DTR and RTS if HUPCL is enabled */
2945 e100_dtr(info, 0); 2947 e100_dtr(info, 0);
2946 e100_rts(info, 0); /* could check CRTSCTS before doing this */ 2948 e100_rts(info, 0); /* could check CRTSCTS before doing this */
2947 } 2949 }
2948 2950
2949 if (info->tty) 2951 if (info->port.tty)
2950 set_bit(TTY_IO_ERROR, &info->tty->flags); 2952 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
2951 2953
2952 info->flags &= ~ASYNC_INITIALIZED; 2954 info->flags &= ~ASYNC_INITIALIZED;
2953 local_irq_restore(flags); 2955 local_irq_restore(flags);
@@ -2964,12 +2966,12 @@ change_speed(struct e100_serial *info)
2964 unsigned long flags; 2966 unsigned long flags;
2965 /* first some safety checks */ 2967 /* first some safety checks */
2966 2968
2967 if (!info->tty || !info->tty->termios) 2969 if (!info->port.tty || !info->port.tty->termios)
2968 return; 2970 return;
2969 if (!info->port) 2971 if (!info->port)
2970 return; 2972 return;
2971 2973
2972 cflag = info->tty->termios->c_cflag; 2974 cflag = info->port.tty->termios->c_cflag;
2973 2975
2974 /* possibly, the tx/rx should be disabled first to do this safely */ 2976 /* possibly, the tx/rx should be disabled first to do this safely */
2975 2977
@@ -3097,10 +3099,11 @@ change_speed(struct e100_serial *info)
3097 3099
3098 info->port[REG_TR_CTRL] = info->tx_ctrl; 3100 info->port[REG_TR_CTRL] = info->tx_ctrl;
3099 info->port[REG_REC_CTRL] = info->rx_ctrl; 3101 info->port[REG_REC_CTRL] = info->rx_ctrl;
3100 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->tty)); 3102 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty));
3101 xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); 3103 xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable);
3102 if (info->tty->termios->c_iflag & IXON ) { 3104 if (info->port.tty->termios->c_iflag & IXON ) {
3103 DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n", STOP_CHAR(info->tty))); 3105 DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n",
3106 STOP_CHAR(info->port.tty)));
3104 xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); 3107 xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
3105 } 3108 }
3106 3109
@@ -3475,7 +3478,7 @@ set_serial_info(struct e100_serial *info,
3475 info->type = new_serial.type; 3478 info->type = new_serial.type;
3476 info->close_delay = new_serial.close_delay; 3479 info->close_delay = new_serial.close_delay;
3477 info->closing_wait = new_serial.closing_wait; 3480 info->closing_wait = new_serial.closing_wait;
3478 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 3481 info->port.tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
3479 3482
3480 check_and_exit: 3483 check_and_exit:
3481 if (info->flags & ASYNC_INITIALIZED) { 3484 if (info->flags & ASYNC_INITIALIZED) {
@@ -3811,7 +3814,7 @@ rs_close(struct tty_struct *tty, struct file * filp)
3811 tty_ldisc_flush(tty); 3814 tty_ldisc_flush(tty);
3812 tty->closing = 0; 3815 tty->closing = 0;
3813 info->event = 0; 3816 info->event = 0;
3814 info->tty = 0; 3817 info->port.tty = NULL;
3815 if (info->blocked_open) { 3818 if (info->blocked_open) {
3816 if (info->close_delay) 3819 if (info->close_delay)
3817 schedule_timeout_interruptible(info->close_delay); 3820 schedule_timeout_interruptible(info->close_delay);
@@ -3915,7 +3918,7 @@ rs_hangup(struct tty_struct *tty)
3915 info->event = 0; 3918 info->event = 0;
3916 info->count = 0; 3919 info->count = 0;
3917 info->flags &= ~ASYNC_NORMAL_ACTIVE; 3920 info->flags &= ~ASYNC_NORMAL_ACTIVE;
3918 info->tty = 0; 3921 info->port.tty = NULL;
3919 wake_up_interruptible(&info->open_wait); 3922 wake_up_interruptible(&info->open_wait);
3920} 3923}
3921 3924
@@ -4077,9 +4080,9 @@ rs_open(struct tty_struct *tty, struct file * filp)
4077 4080
4078 info->count++; 4081 info->count++;
4079 tty->driver_data = info; 4082 tty->driver_data = info;
4080 info->tty = tty; 4083 info->port.tty = tty;
4081 4084
4082 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; 4085 info->port.tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
4083 4086
4084 if (!tmp_buf) { 4087 if (!tmp_buf) {
4085 page = get_zeroed_page(GFP_KERNEL); 4088 page = get_zeroed_page(GFP_KERNEL);
@@ -4267,14 +4270,14 @@ static int line_info(char *buf, struct e100_serial *info)
4267 (unsigned long)info->max_recv_cnt); 4270 (unsigned long)info->max_recv_cnt);
4268 4271
4269#if 1 4272#if 1
4270 if (info->tty) { 4273 if (info->port.tty) {
4271 4274
4272 if (info->tty->stopped) 4275 if (info->port.tty->stopped)
4273 ret += sprintf(buf+ret, " stopped:%i", 4276 ret += sprintf(buf+ret, " stopped:%i",
4274 (int)info->tty->stopped); 4277 (int)info->port.tty->stopped);
4275 if (info->tty->hw_stopped) 4278 if (info->port.tty->hw_stopped)
4276 ret += sprintf(buf+ret, " hw_stopped:%i", 4279 ret += sprintf(buf+ret, " hw_stopped:%i",
4277 (int)info->tty->hw_stopped); 4280 (int)info->port.tty->hw_stopped);
4278 } 4281 }
4279 4282
4280 { 4283 {
@@ -4465,7 +4468,7 @@ rs_init(void)
4465 info->uses_dma_in = 0; 4468 info->uses_dma_in = 0;
4466 info->uses_dma_out = 0; 4469 info->uses_dma_out = 0;
4467 info->line = i; 4470 info->line = i;
4468 info->tty = 0; 4471 info->port.tty = NULL;
4469 info->type = PORT_ETRAX; 4472 info->type = PORT_ETRAX;
4470 info->tr_running = 0; 4473 info->tr_running = 0;
4471 info->forced_eop = 0; 4474 info->forced_eop = 0;
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c
index 0dddd68b20d2..a81d2c2ff8a2 100644
--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -197,7 +197,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
197 while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) { 197 while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) {
198 dport = &mux->dport[LINE(status)]; 198 dport = &mux->dport[LINE(status)];
199 uport = &dport->port; 199 uport = &dport->port;
200 tty = uport->info->tty; /* point to the proper dev */ 200 tty = uport->info->port.tty; /* point to the proper dev */
201 201
202 ch = UCHAR(status); /* grab the char */ 202 ch = UCHAR(status); /* grab the char */
203 flag = TTY_NORMAL; 203 flag = TTY_NORMAL;
@@ -249,7 +249,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
249 } 249 }
250 for (i = 0; i < DZ_NB_PORT; i++) 250 for (i = 0; i < DZ_NB_PORT; i++)
251 if (lines_rx[i]) 251 if (lines_rx[i])
252 tty_flip_buffer_push(mux->dport[i].port.info->tty); 252 tty_flip_buffer_push(mux->dport[i].port.info->port.tty);
253} 253}
254 254
255/* 255/*
diff --git a/drivers/serial/imx.c b/drivers/serial/imx.c
index 64acb39a51ba..e0da4dc7bbf6 100644
--- a/drivers/serial/imx.c
+++ b/drivers/serial/imx.c
@@ -372,7 +372,7 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
372{ 372{
373 struct imx_port *sport = dev_id; 373 struct imx_port *sport = dev_id;
374 unsigned int rx,flg,ignored = 0; 374 unsigned int rx,flg,ignored = 0;
375 struct tty_struct *tty = sport->port.info->tty; 375 struct tty_struct *tty = sport->port.info->port.tty;
376 unsigned long flags, temp; 376 unsigned long flags, temp;
377 377
378 spin_lock_irqsave(&sport->port.lock,flags); 378 spin_lock_irqsave(&sport->port.lock,flags);
diff --git a/drivers/serial/ioc3_serial.c b/drivers/serial/ioc3_serial.c
index 4f1af71e9a1b..6dd98f9fb89c 100644
--- a/drivers/serial/ioc3_serial.c
+++ b/drivers/serial/ioc3_serial.c
@@ -905,7 +905,7 @@ static void transmit_chars(struct uart_port *the_port)
905 return; 905 return;
906 906
907 info = the_port->info; 907 info = the_port->info;
908 tty = info->tty; 908 tty = info->port.tty;
909 909
910 if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) { 910 if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) {
911 /* Nothing to do or hw stopped */ 911 /* Nothing to do or hw stopped */
@@ -997,14 +997,14 @@ ioc3_change_speed(struct uart_port *the_port,
997 997
998 the_port->ignore_status_mask = N_ALL_INPUT; 998 the_port->ignore_status_mask = N_ALL_INPUT;
999 999
1000 info->tty->low_latency = 1; 1000 info->port.tty->low_latency = 1;
1001 1001
1002 if (I_IGNPAR(info->tty)) 1002 if (I_IGNPAR(info->port.tty))
1003 the_port->ignore_status_mask &= ~(N_PARITY_ERROR 1003 the_port->ignore_status_mask &= ~(N_PARITY_ERROR
1004 | N_FRAMING_ERROR); 1004 | N_FRAMING_ERROR);
1005 if (I_IGNBRK(info->tty)) { 1005 if (I_IGNBRK(info->port.tty)) {
1006 the_port->ignore_status_mask &= ~N_BREAK; 1006 the_port->ignore_status_mask &= ~N_BREAK;
1007 if (I_IGNPAR(info->tty)) 1007 if (I_IGNPAR(info->port.tty))
1008 the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; 1008 the_port->ignore_status_mask &= ~N_OVERRUN_ERROR;
1009 } 1009 }
1010 if (!(cflag & CREAD)) { 1010 if (!(cflag & CREAD)) {
@@ -1399,14 +1399,14 @@ static int receive_chars(struct uart_port *the_port)
1399 /* Make sure all the pointers are "good" ones */ 1399 /* Make sure all the pointers are "good" ones */
1400 if (!info) 1400 if (!info)
1401 return 0; 1401 return 0;
1402 if (!info->tty) 1402 if (!info->port.tty)
1403 return 0; 1403 return 0;
1404 1404
1405 if (!(port->ip_flags & INPUT_ENABLE)) 1405 if (!(port->ip_flags & INPUT_ENABLE))
1406 return 0; 1406 return 0;
1407 1407
1408 spin_lock_irqsave(&the_port->lock, pflags); 1408 spin_lock_irqsave(&the_port->lock, pflags);
1409 tty = info->tty; 1409 tty = info->port.tty;
1410 1410
1411 read_count = do_read(the_port, ch, MAX_CHARS); 1411 read_count = do_read(the_port, ch, MAX_CHARS);
1412 if (read_count > 0) { 1412 if (read_count > 0) {
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index 49b8a82b7b9f..6bab63cd5b29 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -1635,7 +1635,7 @@ static void transmit_chars(struct uart_port *the_port)
1635 return; 1635 return;
1636 1636
1637 info = the_port->info; 1637 info = the_port->info;
1638 tty = info->tty; 1638 tty = info->port.tty;
1639 1639
1640 if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) { 1640 if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) {
1641 /* Nothing to do or hw stopped */ 1641 /* Nothing to do or hw stopped */
@@ -1738,14 +1738,14 @@ ioc4_change_speed(struct uart_port *the_port,
1738 1738
1739 the_port->ignore_status_mask = N_ALL_INPUT; 1739 the_port->ignore_status_mask = N_ALL_INPUT;
1740 1740
1741 info->tty->low_latency = 1; 1741 info->port.tty->low_latency = 1;
1742 1742
1743 if (I_IGNPAR(info->tty)) 1743 if (I_IGNPAR(info->port.tty))
1744 the_port->ignore_status_mask &= ~(N_PARITY_ERROR 1744 the_port->ignore_status_mask &= ~(N_PARITY_ERROR
1745 | N_FRAMING_ERROR); 1745 | N_FRAMING_ERROR);
1746 if (I_IGNBRK(info->tty)) { 1746 if (I_IGNBRK(info->port.tty)) {
1747 the_port->ignore_status_mask &= ~N_BREAK; 1747 the_port->ignore_status_mask &= ~N_BREAK;
1748 if (I_IGNPAR(info->tty)) 1748 if (I_IGNPAR(info->port.tty))
1749 the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; 1749 the_port->ignore_status_mask &= ~N_OVERRUN_ERROR;
1750 } 1750 }
1751 if (!(cflag & CREAD)) { 1751 if (!(cflag & CREAD)) {
@@ -1801,7 +1801,8 @@ static inline int ic4_startup_local(struct uart_port *the_port)
1801 ioc4_set_proto(port, the_port->mapbase); 1801 ioc4_set_proto(port, the_port->mapbase);
1802 1802
1803 /* set the speed of the serial port */ 1803 /* set the speed of the serial port */
1804 ioc4_change_speed(the_port, info->tty->termios, (struct ktermios *)0); 1804 ioc4_change_speed(the_port, info->port.tty->termios,
1805 (struct ktermios *)0);
1805 1806
1806 return 0; 1807 return 0;
1807} 1808}
@@ -2346,11 +2347,11 @@ static void receive_chars(struct uart_port *the_port)
2346 /* Make sure all the pointers are "good" ones */ 2347 /* Make sure all the pointers are "good" ones */
2347 if (!info) 2348 if (!info)
2348 return; 2349 return;
2349 if (!info->tty) 2350 if (!info->port.tty)
2350 return; 2351 return;
2351 2352
2352 spin_lock_irqsave(&the_port->lock, pflags); 2353 spin_lock_irqsave(&the_port->lock, pflags);
2353 tty = info->tty; 2354 tty = info->port.tty;
2354 2355
2355 request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS); 2356 request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS);
2356 2357
@@ -2440,8 +2441,8 @@ static void ic4_shutdown(struct uart_port *the_port)
2440 2441
2441 wake_up_interruptible(&info->delta_msr_wait); 2442 wake_up_interruptible(&info->delta_msr_wait);
2442 2443
2443 if (info->tty) 2444 if (info->port.tty)
2444 set_bit(TTY_IO_ERROR, &info->tty->flags); 2445 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
2445 2446
2446 spin_lock_irqsave(&the_port->lock, port_flags); 2447 spin_lock_irqsave(&the_port->lock, port_flags);
2447 set_notification(port, N_ALL, 0); 2448 set_notification(port, N_ALL, 0);
diff --git a/drivers/serial/ip22zilog.c b/drivers/serial/ip22zilog.c
index 9c95bc0398ad..0d9acbd0bb70 100644
--- a/drivers/serial/ip22zilog.c
+++ b/drivers/serial/ip22zilog.c
@@ -257,8 +257,8 @@ static struct tty_struct *ip22zilog_receive_chars(struct uart_ip22zilog_port *up
257 257
258 tty = NULL; 258 tty = NULL;
259 if (up->port.info != NULL && 259 if (up->port.info != NULL &&
260 up->port.info->tty != NULL) 260 up->port.info->port.tty != NULL)
261 tty = up->port.info->tty; 261 tty = up->port.info->port.tty;
262 262
263 for (;;) { 263 for (;;) {
264 ch = readb(&channel->control); 264 ch = readb(&channel->control);
diff --git a/drivers/serial/jsm/jsm_neo.c b/drivers/serial/jsm/jsm_neo.c
index b2d6f5b1a7c2..b7584ca55ade 100644
--- a/drivers/serial/jsm/jsm_neo.c
+++ b/drivers/serial/jsm/jsm_neo.c
@@ -998,7 +998,7 @@ static void neo_param(struct jsm_channel *ch)
998 { 50, B50 }, 998 { 50, B50 },
999 }; 999 };
1000 1000
1001 cflag = C_BAUD(ch->uart_port.info->tty); 1001 cflag = C_BAUD(ch->uart_port.info->port.tty);
1002 baud = 9600; 1002 baud = 9600;
1003 for (i = 0; i < ARRAY_SIZE(baud_rates); i++) { 1003 for (i = 0; i < ARRAY_SIZE(baud_rates); i++) {
1004 if (baud_rates[i].cflag == cflag) { 1004 if (baud_rates[i].cflag == cflag) {
diff --git a/drivers/serial/jsm/jsm_tty.c b/drivers/serial/jsm/jsm_tty.c
index 94ec66372508..a697914ae3d0 100644
--- a/drivers/serial/jsm/jsm_tty.c
+++ b/drivers/serial/jsm/jsm_tty.c
@@ -145,7 +145,7 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch)
145 struct ktermios *termios; 145 struct ktermios *termios;
146 146
147 spin_lock_irqsave(&port->lock, lock_flags); 147 spin_lock_irqsave(&port->lock, lock_flags);
148 termios = port->info->tty->termios; 148 termios = port->info->port.tty->termios;
149 if (ch == termios->c_cc[VSTART]) 149 if (ch == termios->c_cc[VSTART])
150 channel->ch_bd->bd_ops->send_start_character(channel); 150 channel->ch_bd->bd_ops->send_start_character(channel);
151 151
@@ -239,7 +239,7 @@ static int jsm_tty_open(struct uart_port *port)
239 channel->ch_cached_lsr = 0; 239 channel->ch_cached_lsr = 0;
240 channel->ch_stops_sent = 0; 240 channel->ch_stops_sent = 0;
241 241
242 termios = port->info->tty->termios; 242 termios = port->info->port.tty->termios;
243 channel->ch_c_cflag = termios->c_cflag; 243 channel->ch_c_cflag = termios->c_cflag;
244 channel->ch_c_iflag = termios->c_iflag; 244 channel->ch_c_iflag = termios->c_iflag;
245 channel->ch_c_oflag = termios->c_oflag; 245 channel->ch_c_oflag = termios->c_oflag;
@@ -272,7 +272,7 @@ static void jsm_tty_close(struct uart_port *port)
272 jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n"); 272 jsm_printk(CLOSE, INFO, &channel->ch_bd->pci_dev, "start\n");
273 273
274 bd = channel->ch_bd; 274 bd = channel->ch_bd;
275 ts = channel->uart_port.info->tty->termios; 275 ts = channel->uart_port.info->port.tty->termios;
276 276
277 channel->ch_flags &= ~(CH_STOPI); 277 channel->ch_flags &= ~(CH_STOPI);
278 278
@@ -515,7 +515,7 @@ void jsm_input(struct jsm_channel *ch)
515 if (!ch) 515 if (!ch)
516 return; 516 return;
517 517
518 tp = ch->uart_port.info->tty; 518 tp = ch->uart_port.info->port.tty;
519 519
520 bd = ch->ch_bd; 520 bd = ch->ch_bd;
521 if(!bd) 521 if(!bd)
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c
index c2bb11c02bde..23d030511019 100644
--- a/drivers/serial/m32r_sio.c
+++ b/drivers/serial/m32r_sio.c
@@ -325,7 +325,7 @@ static void m32r_sio_enable_ms(struct uart_port *port)
325 325
326static void receive_chars(struct uart_sio_port *up, int *status) 326static void receive_chars(struct uart_sio_port *up, int *status)
327{ 327{
328 struct tty_struct *tty = up->port.info->tty; 328 struct tty_struct *tty = up->port.info->port.tty;
329 unsigned char ch; 329 unsigned char ch;
330 unsigned char flag; 330 unsigned char flag;
331 int max_count = 256; 331 int max_count = 256;
@@ -1160,7 +1160,7 @@ static int __init m32r_sio_init(void)
1160{ 1160{
1161 int ret, i; 1161 int ret, i;
1162 1162
1163 printk(KERN_INFO "Serial: M32R SIO driver $Revision: 1.11 $ "); 1163 printk(KERN_INFO "Serial: M32R SIO driver\n");
1164 1164
1165 for (i = 0; i < NR_IRQS; i++) 1165 for (i = 0; i < NR_IRQS; i++)
1166 spin_lock_init(&irq_lists[i].lock); 1166 spin_lock_init(&irq_lists[i].lock);
@@ -1189,4 +1189,4 @@ EXPORT_SYMBOL(m32r_sio_suspend_port);
1189EXPORT_SYMBOL(m32r_sio_resume_port); 1189EXPORT_SYMBOL(m32r_sio_resume_port);
1190 1190
1191MODULE_LICENSE("GPL"); 1191MODULE_LICENSE("GPL");
1192MODULE_DESCRIPTION("Generic M32R SIO serial driver $Revision: 1.11 $"); 1192MODULE_DESCRIPTION("Generic M32R SIO serial driver");
diff --git a/drivers/serial/mcf.c b/drivers/serial/mcf.c
index 7e164e0cd211..b2001c5b145c 100644
--- a/drivers/serial/mcf.c
+++ b/drivers/serial/mcf.c
@@ -312,7 +312,7 @@ static void mcf_rx_chars(struct mcf_uart *pp)
312 uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag); 312 uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag);
313 } 313 }
314 314
315 tty_flip_buffer_push(port->info->tty); 315 tty_flip_buffer_push(port->info->port.tty);
316} 316}
317 317
318/****************************************************************************/ 318/****************************************************************************/
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c
index 56007cc8a9b3..fbe3835f6b77 100644
--- a/drivers/serial/mcfserial.c
+++ b/drivers/serial/mcfserial.c
@@ -327,7 +327,7 @@ static void mcfrs_start(struct tty_struct *tty)
327static inline void receive_chars(struct mcf_serial *info) 327static inline void receive_chars(struct mcf_serial *info)
328{ 328{
329 volatile unsigned char *uartp; 329 volatile unsigned char *uartp;
330 struct tty_struct *tty = info->tty; 330 struct tty_struct *tty = info->port.tty;
331 unsigned char status, ch, flag; 331 unsigned char status, ch, flag;
332 332
333 if (!tty) 333 if (!tty)
@@ -382,7 +382,7 @@ static inline void transmit_chars(struct mcf_serial *info)
382 info->stats.tx++; 382 info->stats.tx++;
383 } 383 }
384 384
385 if ((info->xmit_cnt <= 0) || info->tty->stopped) { 385 if ((info->xmit_cnt <= 0) || info->port.tty->stopped) {
386 info->imr &= ~MCFUART_UIR_TXREADY; 386 info->imr &= ~MCFUART_UIR_TXREADY;
387 uartp[MCFUART_UIMR] = info->imr; 387 uartp[MCFUART_UIMR] = info->imr;
388 return; 388 return;
@@ -428,7 +428,7 @@ irqreturn_t mcfrs_interrupt(int irq, void *dev_id)
428static void mcfrs_offintr(struct work_struct *work) 428static void mcfrs_offintr(struct work_struct *work)
429{ 429{
430 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue); 430 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue);
431 struct tty_struct *tty = info->tty; 431 struct tty_struct *tty = info->port.tty;
432 432
433 if (tty) 433 if (tty)
434 tty_wakeup(tty); 434 tty_wakeup(tty);
@@ -498,7 +498,7 @@ static void mcfrs_timer(void)
498static void do_serial_hangup(struct work_struct *work) 498static void do_serial_hangup(struct work_struct *work)
499{ 499{
500 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue_hangup); 500 struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue_hangup);
501 struct tty_struct *tty = info->tty; 501 struct tty_struct *tty = info->port.tty;
502 502
503 if (tty) 503 if (tty)
504 tty_hangup(tty); 504 tty_hangup(tty);
@@ -532,8 +532,8 @@ static int startup(struct mcf_serial * info)
532 uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */ 532 uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */
533 mcfrs_setsignals(info, 1, 1); 533 mcfrs_setsignals(info, 1, 1);
534 534
535 if (info->tty) 535 if (info->port.tty)
536 clear_bit(TTY_IO_ERROR, &info->tty->flags); 536 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
537 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; 537 info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
538 538
539 /* 539 /*
@@ -578,7 +578,7 @@ static void shutdown(struct mcf_serial * info)
578 uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETRX; /* reset RX */ 578 uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETRX; /* reset RX */
579 uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */ 579 uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */
580 580
581 if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) 581 if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL))
582 mcfrs_setsignals(info, 0, 0); 582 mcfrs_setsignals(info, 0, 0);
583 583
584 if (info->xmit_buf) { 584 if (info->xmit_buf) {
@@ -586,8 +586,8 @@ static void shutdown(struct mcf_serial * info)
586 info->xmit_buf = 0; 586 info->xmit_buf = 0;
587 } 587 }
588 588
589 if (info->tty) 589 if (info->port.tty)
590 set_bit(TTY_IO_ERROR, &info->tty->flags); 590 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
591 591
592 info->flags &= ~ASYNC_INITIALIZED; 592 info->flags &= ~ASYNC_INITIALIZED;
593 local_irq_restore(flags); 593 local_irq_restore(flags);
@@ -609,9 +609,9 @@ static void mcfrs_change_speed(struct mcf_serial *info)
609 unsigned int fraction; 609 unsigned int fraction;
610#endif 610#endif
611 611
612 if (!info->tty || !info->tty->termios) 612 if (!info->port.tty || !info->port.tty->termios)
613 return; 613 return;
614 cflag = info->tty->termios->c_cflag; 614 cflag = info->port.tty->termios->c_cflag;
615 if (info->addr == 0) 615 if (info->addr == 0)
616 return; 616 return;
617 617
@@ -623,7 +623,7 @@ static void mcfrs_change_speed(struct mcf_serial *info)
623 if (i & CBAUDEX) { 623 if (i & CBAUDEX) {
624 i &= ~CBAUDEX; 624 i &= ~CBAUDEX;
625 if (i < 1 || i > 4) 625 if (i < 1 || i > 4)
626 info->tty->termios->c_cflag &= ~CBAUDEX; 626 info->port.tty->termios->c_cflag &= ~CBAUDEX;
627 else 627 else
628 i += 15; 628 i += 15;
629 } 629 }
@@ -1216,7 +1216,7 @@ static void mcfrs_close(struct tty_struct *tty, struct file * filp)
1216 1216
1217 tty->closing = 0; 1217 tty->closing = 0;
1218 info->event = 0; 1218 info->event = 0;
1219 info->tty = 0; 1219 info->port.tty = NULL;
1220#if 0 1220#if 0
1221 if (tty->ldisc.num != ldiscs[N_TTY].num) { 1221 if (tty->ldisc.num != ldiscs[N_TTY].num) {
1222 if (tty->ldisc.close) 1222 if (tty->ldisc.close)
@@ -1325,7 +1325,7 @@ void mcfrs_hangup(struct tty_struct *tty)
1325 info->event = 0; 1325 info->event = 0;
1326 info->count = 0; 1326 info->count = 0;
1327 info->flags &= ~ASYNC_NORMAL_ACTIVE; 1327 info->flags &= ~ASYNC_NORMAL_ACTIVE;
1328 info->tty = 0; 1328 info->port.tty = NULL;
1329 wake_up_interruptible(&info->open_wait); 1329 wake_up_interruptible(&info->open_wait);
1330} 1330}
1331 1331
@@ -1452,7 +1452,7 @@ int mcfrs_open(struct tty_struct *tty, struct file * filp)
1452#endif 1452#endif
1453 info->count++; 1453 info->count++;
1454 tty->driver_data = info; 1454 tty->driver_data = info;
1455 info->tty = tty; 1455 info->port.tty = tty;
1456 1456
1457 /* 1457 /*
1458 * Start up serial port 1458 * Start up serial port
@@ -1767,7 +1767,7 @@ mcfrs_init(void)
1767 for (i = 0, info = mcfrs_table; (i < NR_PORTS); i++, info++) { 1767 for (i = 0, info = mcfrs_table; (i < NR_PORTS); i++, info++) {
1768 info->magic = SERIAL_MAGIC; 1768 info->magic = SERIAL_MAGIC;
1769 info->line = i; 1769 info->line = i;
1770 info->tty = 0; 1770 info->port.tty = NULL;
1771 info->custom_divisor = 16; 1771 info->custom_divisor = 16;
1772 info->close_delay = 50; 1772 info->close_delay = 50;
1773 info->closing_wait = 3000; 1773 info->closing_wait = 3000;
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index efc971d9647b..36126070d9af 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -732,7 +732,7 @@ static struct uart_ops mpc52xx_uart_ops = {
732static inline int 732static inline int
733mpc52xx_uart_int_rx_chars(struct uart_port *port) 733mpc52xx_uart_int_rx_chars(struct uart_port *port)
734{ 734{
735 struct tty_struct *tty = port->info->tty; 735 struct tty_struct *tty = port->info->port.tty;
736 unsigned char ch, flag; 736 unsigned char ch, flag;
737 unsigned short status; 737 unsigned short status;
738 738
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index e8819c43f57d..c9f53e71f252 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -932,7 +932,7 @@ static int mpsc_make_ready(struct mpsc_port_info *pi)
932static int mpsc_rx_intr(struct mpsc_port_info *pi) 932static int mpsc_rx_intr(struct mpsc_port_info *pi)
933{ 933{
934 struct mpsc_rx_desc *rxre; 934 struct mpsc_rx_desc *rxre;
935 struct tty_struct *tty = pi->port.info->tty; 935 struct tty_struct *tty = pi->port.info->port.tty;
936 u32 cmdstat, bytes_in, i; 936 u32 cmdstat, bytes_in, i;
937 int rc = 0; 937 int rc = 0;
938 u8 *bp; 938 u8 *bp;
@@ -1972,7 +1972,7 @@ static int __init mpsc_drv_init(void)
1972{ 1972{
1973 int rc; 1973 int rc;
1974 1974
1975 printk(KERN_INFO "Serial: MPSC driver $Revision: 1.00 $\n"); 1975 printk(KERN_INFO "Serial: MPSC driver\n");
1976 1976
1977 memset(mpsc_ports, 0, sizeof(mpsc_ports)); 1977 memset(mpsc_ports, 0, sizeof(mpsc_ports));
1978 memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs)); 1978 memset(&mpsc_shared_regs, 0, sizeof(mpsc_shared_regs));
@@ -2004,7 +2004,7 @@ module_init(mpsc_drv_init);
2004module_exit(mpsc_drv_exit); 2004module_exit(mpsc_drv_exit);
2005 2005
2006MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>"); 2006MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>");
2007MODULE_DESCRIPTION("Generic Marvell MPSC serial/UART driver $Revision: 1.00 $"); 2007MODULE_DESCRIPTION("Generic Marvell MPSC serial/UART driver");
2008MODULE_VERSION(MPSC_VERSION); 2008MODULE_VERSION(MPSC_VERSION);
2009MODULE_LICENSE("GPL"); 2009MODULE_LICENSE("GPL");
2010MODULE_ALIAS_CHARDEV_MAJOR(MPSC_MAJOR); 2010MODULE_ALIAS_CHARDEV_MAJOR(MPSC_MAJOR);
diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c
index e94031731a47..953a5ffa9b44 100644
--- a/drivers/serial/mux.c
+++ b/drivers/serial/mux.c
@@ -243,7 +243,7 @@ static void mux_write(struct uart_port *port)
243static void mux_read(struct uart_port *port) 243static void mux_read(struct uart_port *port)
244{ 244{
245 int data; 245 int data;
246 struct tty_struct *tty = port->info->tty; 246 struct tty_struct *tty = port->info->port.tty;
247 __u32 start_count = port->icount.rx; 247 __u32 start_count = port->icount.rx;
248 248
249 while(1) { 249 while(1) {
diff --git a/drivers/serial/netx-serial.c b/drivers/serial/netx-serial.c
index 81ac9bb4f39b..9f8ccb735c19 100644
--- a/drivers/serial/netx-serial.c
+++ b/drivers/serial/netx-serial.c
@@ -203,7 +203,7 @@ static void netx_txint(struct uart_port *port)
203static void netx_rxint(struct uart_port *port) 203static void netx_rxint(struct uart_port *port)
204{ 204{
205 unsigned char rx, flg, status; 205 unsigned char rx, flg, status;
206 struct tty_struct *tty = port->info->tty; 206 struct tty_struct *tty = port->info->port.tty;
207 207
208 while (!(readl(port->membase + UART_FR) & FR_RXFE)) { 208 while (!(readl(port->membase + UART_FR) & FR_RXFE)) {
209 rx = readl(port->membase + UART_DR); 209 rx = readl(port->membase + UART_DR);
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c
index 794bd0f50d73..317b061f7641 100644
--- a/drivers/serial/pmac_zilog.c
+++ b/drivers/serial/pmac_zilog.c
@@ -242,12 +242,12 @@ static struct tty_struct *pmz_receive_chars(struct uart_pmac_port *uap)
242 } 242 }
243 243
244 /* Sanity check, make sure the old bug is no longer happening */ 244 /* Sanity check, make sure the old bug is no longer happening */
245 if (uap->port.info == NULL || uap->port.info->tty == NULL) { 245 if (uap->port.info == NULL || uap->port.info->port.tty == NULL) {
246 WARN_ON(1); 246 WARN_ON(1);
247 (void)read_zsdata(uap); 247 (void)read_zsdata(uap);
248 return NULL; 248 return NULL;
249 } 249 }
250 tty = uap->port.info->tty; 250 tty = uap->port.info->port.tty;
251 251
252 while (1) { 252 while (1) {
253 error = 0; 253 error = 0;
diff --git a/drivers/serial/pnx8xxx_uart.c b/drivers/serial/pnx8xxx_uart.c
index d0e5a79ea635..22e30d21225e 100644
--- a/drivers/serial/pnx8xxx_uart.c
+++ b/drivers/serial/pnx8xxx_uart.c
@@ -181,7 +181,7 @@ static void pnx8xxx_enable_ms(struct uart_port *port)
181 181
182static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) 182static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport)
183{ 183{
184 struct tty_struct *tty = sport->port.info->tty; 184 struct tty_struct *tty = sport->port.info->port.tty;
185 unsigned int status, ch, flg; 185 unsigned int status, ch, flg;
186 186
187 status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) | 187 status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) |
@@ -824,7 +824,7 @@ static int __init pnx8xxx_serial_init(void)
824{ 824{
825 int ret; 825 int ret;
826 826
827 printk(KERN_INFO "Serial: PNX8XXX driver $Revision: 1.2 $\n"); 827 printk(KERN_INFO "Serial: PNX8XXX driver\n");
828 828
829 pnx8xxx_init_ports(); 829 pnx8xxx_init_ports();
830 830
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index b4f7ffb7688d..b9a93f326fb8 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -101,7 +101,7 @@ static void serial_pxa_stop_rx(struct uart_port *port)
101 101
102static inline void receive_chars(struct uart_pxa_port *up, int *status) 102static inline void receive_chars(struct uart_pxa_port *up, int *status)
103{ 103{
104 struct tty_struct *tty = up->port.info->tty; 104 struct tty_struct *tty = up->port.info->port.tty;
105 unsigned int ch, flag; 105 unsigned int ch, flag;
106 int max_count = 256; 106 int max_count = 256;
107 107
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c
index 62b38582f5e9..a5e76cc18073 100644
--- a/drivers/serial/sa1100.c
+++ b/drivers/serial/sa1100.c
@@ -20,9 +20,6 @@
20 * You should have received a copy of the GNU General Public License 20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software 21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 * $Id: sa1100.c,v 1.50 2002/07/29 14:41:04 rmk Exp $
25 *
26 */ 23 */
27 24
28#if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 25#if defined(CONFIG_SERIAL_SA1100_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
@@ -192,7 +189,7 @@ static void sa1100_enable_ms(struct uart_port *port)
192static void 189static void
193sa1100_rx_chars(struct sa1100_port *sport) 190sa1100_rx_chars(struct sa1100_port *sport)
194{ 191{
195 struct tty_struct *tty = sport->port.info->tty; 192 struct tty_struct *tty = sport->port.info->port.tty;
196 unsigned int status, ch, flg; 193 unsigned int status, ch, flg;
197 194
198 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | 195 status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
@@ -892,7 +889,7 @@ static int __init sa1100_serial_init(void)
892{ 889{
893 int ret; 890 int ret;
894 891
895 printk(KERN_INFO "Serial: SA11x0 driver $Revision: 1.50 $\n"); 892 printk(KERN_INFO "Serial: SA11x0 driver\n");
896 893
897 sa1100_init_ports(); 894 sa1100_init_ports();
898 895
@@ -915,7 +912,7 @@ module_init(sa1100_serial_init);
915module_exit(sa1100_serial_exit); 912module_exit(sa1100_serial_exit);
916 913
917MODULE_AUTHOR("Deep Blue Solutions Ltd"); 914MODULE_AUTHOR("Deep Blue Solutions Ltd");
918MODULE_DESCRIPTION("SA1100 generic serial port driver $Revision: 1.50 $"); 915MODULE_DESCRIPTION("SA1100 generic serial port driver");
919MODULE_LICENSE("GPL"); 916MODULE_LICENSE("GPL");
920MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_SA1100_MAJOR); 917MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_SA1100_MAJOR);
921MODULE_ALIAS("platform:sa11x0-uart"); 918MODULE_ALIAS("platform:sa11x0-uart");
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c
index f8e1447a022a..a4fb343a08da 100644
--- a/drivers/serial/sb1250-duart.c
+++ b/drivers/serial/sb1250-duart.c
@@ -384,7 +384,7 @@ static void sbd_receive_chars(struct sbd_port *sport)
384 uart_insert_char(uport, status, M_DUART_OVRUN_ERR, ch, flag); 384 uart_insert_char(uport, status, M_DUART_OVRUN_ERR, ch, flag);
385 } 385 }
386 386
387 tty_flip_buffer_push(uport->info->tty); 387 tty_flip_buffer_push(uport->info->port.tty);
388} 388}
389 389
390static void sbd_transmit_chars(struct sbd_port *sport) 390static void sbd_transmit_chars(struct sbd_port *sport)
diff --git a/drivers/serial/sc26xx.c b/drivers/serial/sc26xx.c
index ae2a9e2df777..e0be11ceaa25 100644
--- a/drivers/serial/sc26xx.c
+++ b/drivers/serial/sc26xx.c
@@ -141,7 +141,7 @@ static struct tty_struct *receive_chars(struct uart_port *port)
141 u8 status; 141 u8 status;
142 142
143 if (port->info != NULL) /* Unopened serial console */ 143 if (port->info != NULL) /* Unopened serial console */
144 tty = port->info->tty; 144 tty = port->info->port.tty;
145 145
146 while (limit-- > 0) { 146 while (limit-- > 0) {
147 status = READ_SC_PORT(port, SR); 147 status = READ_SC_PORT(port, SR);
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index 42d2e108b679..0bce1fe2c62a 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -50,7 +50,7 @@ static struct lock_class_key port_lock_key;
50 50
51#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8) 51#define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
52 52
53#define uart_users(state) ((state)->count + ((state)->info ? (state)->info->blocked_open : 0)) 53#define uart_users(state) ((state)->count + ((state)->info ? (state)->info->port.blocked_open : 0))
54 54
55#ifdef CONFIG_SERIAL_CORE_CONSOLE 55#ifdef CONFIG_SERIAL_CORE_CONSOLE
56#define uart_console(port) ((port)->cons && (port)->cons->index == (port)->line) 56#define uart_console(port) ((port)->cons && (port)->cons->index == (port)->line)
@@ -113,7 +113,7 @@ static void uart_start(struct tty_struct *tty)
113static void uart_tasklet_action(unsigned long data) 113static void uart_tasklet_action(unsigned long data)
114{ 114{
115 struct uart_state *state = (struct uart_state *)data; 115 struct uart_state *state = (struct uart_state *)data;
116 tty_wakeup(state->info->tty); 116 tty_wakeup(state->info->port.tty);
117} 117}
118 118
119static inline void 119static inline void
@@ -135,7 +135,7 @@ uart_update_mctrl(struct uart_port *port, unsigned int set, unsigned int clear)
135 135
136/* 136/*
137 * Startup the port. This will be called once per open. All calls 137 * Startup the port. This will be called once per open. All calls
138 * will be serialised by the per-port semaphore. 138 * will be serialised by the per-port mutex.
139 */ 139 */
140static int uart_startup(struct uart_state *state, int init_hw) 140static int uart_startup(struct uart_state *state, int init_hw)
141{ 141{
@@ -152,7 +152,7 @@ static int uart_startup(struct uart_state *state, int init_hw)
152 * once we have successfully opened the port. Also set 152 * once we have successfully opened the port. Also set
153 * up the tty->alt_speed kludge 153 * up the tty->alt_speed kludge
154 */ 154 */
155 set_bit(TTY_IO_ERROR, &info->tty->flags); 155 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
156 156
157 if (port->type == PORT_UNKNOWN) 157 if (port->type == PORT_UNKNOWN)
158 return 0; 158 return 0;
@@ -162,6 +162,7 @@ static int uart_startup(struct uart_state *state, int init_hw)
162 * buffer. 162 * buffer.
163 */ 163 */
164 if (!info->xmit.buf) { 164 if (!info->xmit.buf) {
165 /* This is protected by the per port mutex */
165 page = get_zeroed_page(GFP_KERNEL); 166 page = get_zeroed_page(GFP_KERNEL);
166 if (!page) 167 if (!page)
167 return -ENOMEM; 168 return -ENOMEM;
@@ -182,20 +183,20 @@ static int uart_startup(struct uart_state *state, int init_hw)
182 * Setup the RTS and DTR signals once the 183 * Setup the RTS and DTR signals once the
183 * port is open and ready to respond. 184 * port is open and ready to respond.
184 */ 185 */
185 if (info->tty->termios->c_cflag & CBAUD) 186 if (info->port.tty->termios->c_cflag & CBAUD)
186 uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR); 187 uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR);
187 } 188 }
188 189
189 if (info->flags & UIF_CTS_FLOW) { 190 if (info->flags & UIF_CTS_FLOW) {
190 spin_lock_irq(&port->lock); 191 spin_lock_irq(&port->lock);
191 if (!(port->ops->get_mctrl(port) & TIOCM_CTS)) 192 if (!(port->ops->get_mctrl(port) & TIOCM_CTS))
192 info->tty->hw_stopped = 1; 193 info->port.tty->hw_stopped = 1;
193 spin_unlock_irq(&port->lock); 194 spin_unlock_irq(&port->lock);
194 } 195 }
195 196
196 info->flags |= UIF_INITIALIZED; 197 info->flags |= UIF_INITIALIZED;
197 198
198 clear_bit(TTY_IO_ERROR, &info->tty->flags); 199 clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
199 } 200 }
200 201
201 if (retval && capable(CAP_SYS_ADMIN)) 202 if (retval && capable(CAP_SYS_ADMIN))
@@ -217,8 +218,8 @@ static void uart_shutdown(struct uart_state *state)
217 /* 218 /*
218 * Set the TTY IO error marker 219 * Set the TTY IO error marker
219 */ 220 */
220 if (info->tty) 221 if (info->port.tty)
221 set_bit(TTY_IO_ERROR, &info->tty->flags); 222 set_bit(TTY_IO_ERROR, &info->port.tty->flags);
222 223
223 if (info->flags & UIF_INITIALIZED) { 224 if (info->flags & UIF_INITIALIZED) {
224 info->flags &= ~UIF_INITIALIZED; 225 info->flags &= ~UIF_INITIALIZED;
@@ -226,7 +227,7 @@ static void uart_shutdown(struct uart_state *state)
226 /* 227 /*
227 * Turn off DTR and RTS early. 228 * Turn off DTR and RTS early.
228 */ 229 */
229 if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) 230 if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL))
230 uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS); 231 uart_clear_mctrl(port, TIOCM_DTR | TIOCM_RTS);
231 232
232 /* 233 /*
@@ -426,7 +427,7 @@ EXPORT_SYMBOL(uart_get_divisor);
426static void 427static void
427uart_change_speed(struct uart_state *state, struct ktermios *old_termios) 428uart_change_speed(struct uart_state *state, struct ktermios *old_termios)
428{ 429{
429 struct tty_struct *tty = state->info->tty; 430 struct tty_struct *tty = state->info->port.tty;
430 struct uart_port *port = state->port; 431 struct uart_port *port = state->port;
431 struct ktermios *termios; 432 struct ktermios *termios;
432 433
@@ -573,6 +574,8 @@ static void uart_flush_buffer(struct tty_struct *tty)
573 574
574 spin_lock_irqsave(&port->lock, flags); 575 spin_lock_irqsave(&port->lock, flags);
575 uart_circ_clear(&state->info->xmit); 576 uart_circ_clear(&state->info->xmit);
577 if (port->ops->flush_buffer)
578 port->ops->flush_buffer(port);
576 spin_unlock_irqrestore(&port->lock, flags); 579 spin_unlock_irqrestore(&port->lock, flags);
577 tty_wakeup(tty); 580 tty_wakeup(tty);
578} 581}
@@ -834,8 +837,8 @@ static int uart_set_info(struct uart_state *state,
834 state->closing_wait = closing_wait; 837 state->closing_wait = closing_wait;
835 if (new_serial.xmit_fifo_size) 838 if (new_serial.xmit_fifo_size)
836 port->fifosize = new_serial.xmit_fifo_size; 839 port->fifosize = new_serial.xmit_fifo_size;
837 if (state->info->tty) 840 if (state->info->port.tty)
838 state->info->tty->low_latency = 841 state->info->port.tty->low_latency =
839 (port->flags & UPF_LOW_LATENCY) ? 1 : 0; 842 (port->flags & UPF_LOW_LATENCY) ? 1 : 0;
840 843
841 check_and_exit: 844 check_and_exit:
@@ -855,7 +858,7 @@ static int uart_set_info(struct uart_state *state,
855 printk(KERN_NOTICE 858 printk(KERN_NOTICE
856 "%s sets custom speed on %s. This " 859 "%s sets custom speed on %s. This "
857 "is deprecated.\n", current->comm, 860 "is deprecated.\n", current->comm,
858 tty_name(state->info->tty, buf)); 861 tty_name(state->info->port.tty, buf));
859 } 862 }
860 uart_change_speed(state, NULL); 863 uart_change_speed(state, NULL);
861 } 864 }
@@ -887,7 +890,7 @@ static int uart_get_lsr_info(struct uart_state *state,
887 */ 890 */
888 if (port->x_char || 891 if (port->x_char ||
889 ((uart_circ_chars_pending(&state->info->xmit) > 0) && 892 ((uart_circ_chars_pending(&state->info->xmit) > 0) &&
890 !state->info->tty->stopped && !state->info->tty->hw_stopped)) 893 !state->info->port.tty->stopped && !state->info->port.tty->hw_stopped))
891 result &= ~TIOCSER_TEMT; 894 result &= ~TIOCSER_TEMT;
892 895
893 return put_user(result, value); 896 return put_user(result, value);
@@ -1237,7 +1240,7 @@ static void uart_set_termios(struct tty_struct *tty,
1237 */ 1240 */
1238 if (!(old_termios->c_cflag & CLOCAL) && 1241 if (!(old_termios->c_cflag & CLOCAL) &&
1239 (tty->termios->c_cflag & CLOCAL)) 1242 (tty->termios->c_cflag & CLOCAL))
1240 wake_up_interruptible(&state->info->open_wait); 1243 wake_up_interruptible(&state->info->port.open_wait);
1241#endif 1244#endif
1242} 1245}
1243 1246
@@ -1318,9 +1321,9 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
1318 tty_ldisc_flush(tty); 1321 tty_ldisc_flush(tty);
1319 1322
1320 tty->closing = 0; 1323 tty->closing = 0;
1321 state->info->tty = NULL; 1324 state->info->port.tty = NULL;
1322 1325
1323 if (state->info->blocked_open) { 1326 if (state->info->port.blocked_open) {
1324 if (state->close_delay) 1327 if (state->close_delay)
1325 msleep_interruptible(state->close_delay); 1328 msleep_interruptible(state->close_delay);
1326 } else if (!uart_console(port)) { 1329 } else if (!uart_console(port)) {
@@ -1331,7 +1334,7 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
1331 * Wake up anyone trying to open this port. 1334 * Wake up anyone trying to open this port.
1332 */ 1335 */
1333 state->info->flags &= ~UIF_NORMAL_ACTIVE; 1336 state->info->flags &= ~UIF_NORMAL_ACTIVE;
1334 wake_up_interruptible(&state->info->open_wait); 1337 wake_up_interruptible(&state->info->port.open_wait);
1335 1338
1336 done: 1339 done:
1337 mutex_unlock(&state->mutex); 1340 mutex_unlock(&state->mutex);
@@ -1415,8 +1418,8 @@ static void uart_hangup(struct tty_struct *tty)
1415 uart_shutdown(state); 1418 uart_shutdown(state);
1416 state->count = 0; 1419 state->count = 0;
1417 state->info->flags &= ~UIF_NORMAL_ACTIVE; 1420 state->info->flags &= ~UIF_NORMAL_ACTIVE;
1418 state->info->tty = NULL; 1421 state->info->port.tty = NULL;
1419 wake_up_interruptible(&state->info->open_wait); 1422 wake_up_interruptible(&state->info->port.open_wait);
1420 wake_up_interruptible(&state->info->delta_msr_wait); 1423 wake_up_interruptible(&state->info->delta_msr_wait);
1421 } 1424 }
1422 mutex_unlock(&state->mutex); 1425 mutex_unlock(&state->mutex);
@@ -1430,7 +1433,7 @@ static void uart_hangup(struct tty_struct *tty)
1430 */ 1433 */
1431static void uart_update_termios(struct uart_state *state) 1434static void uart_update_termios(struct uart_state *state)
1432{ 1435{
1433 struct tty_struct *tty = state->info->tty; 1436 struct tty_struct *tty = state->info->port.tty;
1434 struct uart_port *port = state->port; 1437 struct uart_port *port = state->port;
1435 1438
1436 if (uart_console(port) && port->cons->cflag) { 1439 if (uart_console(port) && port->cons->cflag) {
@@ -1469,17 +1472,17 @@ uart_block_til_ready(struct file *filp, struct uart_state *state)
1469 struct uart_port *port = state->port; 1472 struct uart_port *port = state->port;
1470 unsigned int mctrl; 1473 unsigned int mctrl;
1471 1474
1472 info->blocked_open++; 1475 info->port.blocked_open++;
1473 state->count--; 1476 state->count--;
1474 1477
1475 add_wait_queue(&info->open_wait, &wait); 1478 add_wait_queue(&info->port.open_wait, &wait);
1476 while (1) { 1479 while (1) {
1477 set_current_state(TASK_INTERRUPTIBLE); 1480 set_current_state(TASK_INTERRUPTIBLE);
1478 1481
1479 /* 1482 /*
1480 * If we have been hung up, tell userspace/restart open. 1483 * If we have been hung up, tell userspace/restart open.
1481 */ 1484 */
1482 if (tty_hung_up_p(filp) || info->tty == NULL) 1485 if (tty_hung_up_p(filp) || info->port.tty == NULL)
1483 break; 1486 break;
1484 1487
1485 /* 1488 /*
@@ -1498,8 +1501,8 @@ uart_block_til_ready(struct file *filp, struct uart_state *state)
1498 * have set TTY_IO_ERROR for a non-existant port. 1501 * have set TTY_IO_ERROR for a non-existant port.
1499 */ 1502 */
1500 if ((filp->f_flags & O_NONBLOCK) || 1503 if ((filp->f_flags & O_NONBLOCK) ||
1501 (info->tty->termios->c_cflag & CLOCAL) || 1504 (info->port.tty->termios->c_cflag & CLOCAL) ||
1502 (info->tty->flags & (1 << TTY_IO_ERROR))) 1505 (info->port.tty->flags & (1 << TTY_IO_ERROR)))
1503 break; 1506 break;
1504 1507
1505 /* 1508 /*
@@ -1507,7 +1510,7 @@ uart_block_til_ready(struct file *filp, struct uart_state *state)
1507 * not set RTS here - we want to make sure we catch 1510 * not set RTS here - we want to make sure we catch
1508 * the data from the modem. 1511 * the data from the modem.
1509 */ 1512 */
1510 if (info->tty->termios->c_cflag & CBAUD) 1513 if (info->port.tty->termios->c_cflag & CBAUD)
1511 uart_set_mctrl(port, TIOCM_DTR); 1514 uart_set_mctrl(port, TIOCM_DTR);
1512 1515
1513 /* 1516 /*
@@ -1529,15 +1532,15 @@ uart_block_til_ready(struct file *filp, struct uart_state *state)
1529 break; 1532 break;
1530 } 1533 }
1531 set_current_state(TASK_RUNNING); 1534 set_current_state(TASK_RUNNING);
1532 remove_wait_queue(&info->open_wait, &wait); 1535 remove_wait_queue(&info->port.open_wait, &wait);
1533 1536
1534 state->count++; 1537 state->count++;
1535 info->blocked_open--; 1538 info->port.blocked_open--;
1536 1539
1537 if (signal_pending(current)) 1540 if (signal_pending(current))
1538 return -ERESTARTSYS; 1541 return -ERESTARTSYS;
1539 1542
1540 if (!info->tty || tty_hung_up_p(filp)) 1543 if (!info->port.tty || tty_hung_up_p(filp))
1541 return -EAGAIN; 1544 return -EAGAIN;
1542 1545
1543 return 0; 1546 return 0;
@@ -1560,10 +1563,13 @@ static struct uart_state *uart_get(struct uart_driver *drv, int line)
1560 goto err_unlock; 1563 goto err_unlock;
1561 } 1564 }
1562 1565
1566 /* BKL: RACE HERE - LEAK */
1567 /* We should move this into the uart_state structure and kill off
1568 this whole complexity */
1563 if (!state->info) { 1569 if (!state->info) {
1564 state->info = kzalloc(sizeof(struct uart_info), GFP_KERNEL); 1570 state->info = kzalloc(sizeof(struct uart_info), GFP_KERNEL);
1565 if (state->info) { 1571 if (state->info) {
1566 init_waitqueue_head(&state->info->open_wait); 1572 init_waitqueue_head(&state->info->port.open_wait);
1567 init_waitqueue_head(&state->info->delta_msr_wait); 1573 init_waitqueue_head(&state->info->delta_msr_wait);
1568 1574
1569 /* 1575 /*
@@ -1620,7 +1626,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
1620 * be re-entered while allocating the info structure, or while we 1626 * be re-entered while allocating the info structure, or while we
1621 * request any IRQs that the driver may need. This also has the nice 1627 * request any IRQs that the driver may need. This also has the nice
1622 * side-effect that it delays the action of uart_hangup, so we can 1628 * side-effect that it delays the action of uart_hangup, so we can
1623 * guarantee that info->tty will always contain something reasonable. 1629 * guarantee that info->port.tty will always contain something reasonable.
1624 */ 1630 */
1625 state = uart_get(drv, line); 1631 state = uart_get(drv, line);
1626 if (IS_ERR(state)) { 1632 if (IS_ERR(state)) {
@@ -1636,7 +1642,7 @@ static int uart_open(struct tty_struct *tty, struct file *filp)
1636 tty->driver_data = state; 1642 tty->driver_data = state;
1637 tty->low_latency = (state->port->flags & UPF_LOW_LATENCY) ? 1 : 0; 1643 tty->low_latency = (state->port->flags & UPF_LOW_LATENCY) ? 1 : 0;
1638 tty->alt_speed = 0; 1644 tty->alt_speed = 0;
1639 state->info->tty = tty; 1645 state->info->port.tty = tty;
1640 1646
1641 /* 1647 /*
1642 * If the port is in the middle of closing, bail out now. 1648 * If the port is in the middle of closing, bail out now.
@@ -2099,8 +2105,8 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
2099 /* 2105 /*
2100 * If that's unset, use the tty termios setting. 2106 * If that's unset, use the tty termios setting.
2101 */ 2107 */
2102 if (state->info && state->info->tty && termios.c_cflag == 0) 2108 if (state->info && state->info->port.tty && termios.c_cflag == 0)
2103 termios = *state->info->tty->termios; 2109 termios = *state->info->port.tty->termios;
2104 2110
2105 uart_change_pm(state, 0); 2111 uart_change_pm(state, 0);
2106 port->ops->set_termios(port, &termios, NULL); 2112 port->ops->set_termios(port, &termios, NULL);
@@ -2519,8 +2525,8 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port)
2519 tty_unregister_device(drv->tty_driver, port->line); 2525 tty_unregister_device(drv->tty_driver, port->line);
2520 2526
2521 info = state->info; 2527 info = state->info;
2522 if (info && info->tty) 2528 if (info && info->port.tty)
2523 tty_vhangup(info->tty); 2529 tty_vhangup(info->port.tty);
2524 2530
2525 /* 2531 /*
2526 * All users of this port should now be disconnected from 2532 * All users of this port should now be disconnected from
diff --git a/drivers/serial/serial_ks8695.c b/drivers/serial/serial_ks8695.c
index 8721afe1ae4f..0edbc5dd378b 100644
--- a/drivers/serial/serial_ks8695.c
+++ b/drivers/serial/serial_ks8695.c
@@ -108,7 +108,7 @@ static void ks8695uart_disable_ms(struct uart_port *port)
108static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id) 108static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id)
109{ 109{
110 struct uart_port *port = dev_id; 110 struct uart_port *port = dev_id;
111 struct tty_struct *tty = port->info->tty; 111 struct tty_struct *tty = port->info->port.tty;
112 unsigned int status, ch, lsr, flg, max_count = 256; 112 unsigned int status, ch, lsr, flg, max_count = 256;
113 113
114 status = UART_GET_LSR(port); /* clears pending LSR interrupts */ 114 status = UART_GET_LSR(port); /* clears pending LSR interrupts */
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c
index eb18d429752d..cb49a5ac022f 100644
--- a/drivers/serial/serial_lh7a40x.c
+++ b/drivers/serial/serial_lh7a40x.c
@@ -137,7 +137,7 @@ static void lh7a40xuart_enable_ms (struct uart_port* port)
137 137
138static void lh7a40xuart_rx_chars (struct uart_port* port) 138static void lh7a40xuart_rx_chars (struct uart_port* port)
139{ 139{
140 struct tty_struct* tty = port->info->tty; 140 struct tty_struct* tty = port->info->port.tty;
141 int cbRxMax = 256; /* (Gross) limit on receive */ 141 int cbRxMax = 256; /* (Gross) limit on receive */
142 unsigned int data; /* Received data and status */ 142 unsigned int data; /* Received data and status */
143 unsigned int flag; 143 unsigned int flag;
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index ce6ee92b3a1b..208e42ba9455 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -521,7 +521,7 @@ static void sci_transmit_chars(struct uart_port *port)
521static inline void sci_receive_chars(struct uart_port *port) 521static inline void sci_receive_chars(struct uart_port *port)
522{ 522{
523 struct sci_port *sci_port = (struct sci_port *)port; 523 struct sci_port *sci_port = (struct sci_port *)port;
524 struct tty_struct *tty = port->info->tty; 524 struct tty_struct *tty = port->info->port.tty;
525 int i, count, copied = 0; 525 int i, count, copied = 0;
526 unsigned short status; 526 unsigned short status;
527 unsigned char flag; 527 unsigned char flag;
@@ -642,7 +642,7 @@ static inline int sci_handle_errors(struct uart_port *port)
642{ 642{
643 int copied = 0; 643 int copied = 0;
644 unsigned short status = sci_in(port, SCxSR); 644 unsigned short status = sci_in(port, SCxSR);
645 struct tty_struct *tty = port->info->tty; 645 struct tty_struct *tty = port->info->port.tty;
646 646
647 if (status & SCxSR_ORER(port)) { 647 if (status & SCxSR_ORER(port)) {
648 /* overrun error */ 648 /* overrun error */
@@ -692,7 +692,7 @@ static inline int sci_handle_breaks(struct uart_port *port)
692{ 692{
693 int copied = 0; 693 int copied = 0;
694 unsigned short status = sci_in(port, SCxSR); 694 unsigned short status = sci_in(port, SCxSR);
695 struct tty_struct *tty = port->info->tty; 695 struct tty_struct *tty = port->info->port.tty;
696 struct sci_port *s = &sci_ports[port->line]; 696 struct sci_port *s = &sci_ports[port->line];
697 697
698 if (uart_handle_break(port)) 698 if (uart_handle_break(port))
@@ -762,7 +762,7 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr)
762 } else { 762 } else {
763#if defined(SCIF_ORER) 763#if defined(SCIF_ORER)
764 if((sci_in(port, SCLSR) & SCIF_ORER) != 0) { 764 if((sci_in(port, SCLSR) & SCIF_ORER) != 0) {
765 struct tty_struct *tty = port->info->tty; 765 struct tty_struct *tty = port->info->port.tty;
766 766
767 sci_out(port, SCLSR, 0); 767 sci_out(port, SCLSR, 0);
768 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 768 tty_insert_flip_char(tty, 0, TTY_OVERRUN);
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c
index 019da2e05f0b..b73e3c0056cd 100644
--- a/drivers/serial/sn_console.c
+++ b/drivers/serial/sn_console.c
@@ -471,7 +471,7 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
471 471
472 if (port->sc_port.info) { 472 if (port->sc_port.info) {
473 /* The serial_core stuffs are initilized, use them */ 473 /* The serial_core stuffs are initilized, use them */
474 tty = port->sc_port.info->tty; 474 tty = port->sc_port.info->port.tty;
475 } 475 }
476 else { 476 else {
477 /* Not registered yet - can't pass to tty layer. */ 477 /* Not registered yet - can't pass to tty layer. */
diff --git a/drivers/serial/sunhv.c b/drivers/serial/sunhv.c
index 2847336742d7..aeeec5588afd 100644
--- a/drivers/serial/sunhv.c
+++ b/drivers/serial/sunhv.c
@@ -185,7 +185,7 @@ static struct tty_struct *receive_chars(struct uart_port *port)
185 struct tty_struct *tty = NULL; 185 struct tty_struct *tty = NULL;
186 186
187 if (port->info != NULL) /* Unopened serial console */ 187 if (port->info != NULL) /* Unopened serial console */
188 tty = port->info->tty; 188 tty = port->info->port.tty;
189 189
190 if (sunhv_ops->receive_chars(port, tty)) 190 if (sunhv_ops->receive_chars(port, tty))
191 sun_do_break(); 191 sun_do_break();
diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c
index 9ff5b38f3bee..15ee497e1c78 100644
--- a/drivers/serial/sunsab.c
+++ b/drivers/serial/sunsab.c
@@ -118,7 +118,7 @@ receive_chars(struct uart_sunsab_port *up,
118 int i; 118 int i;
119 119
120 if (up->port.info != NULL) /* Unopened serial console */ 120 if (up->port.info != NULL) /* Unopened serial console */
121 tty = up->port.info->tty; 121 tty = up->port.info->port.tty;
122 122
123 /* Read number of BYTES (Character + Status) available. */ 123 /* Read number of BYTES (Character + Status) available. */
124 if (stat->sreg.isr0 & SAB82532_ISR0_RPF) { 124 if (stat->sreg.isr0 & SAB82532_ISR0_RPF) {
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 03806a935209..e24e68235088 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -1,4 +1,4 @@
1/* $Id: su.c,v 1.55 2002/01/08 16:00:16 davem Exp $ 1/*
2 * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI 2 * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI
3 * 3 *
4 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be) 4 * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
@@ -311,7 +311,7 @@ static void sunsu_enable_ms(struct uart_port *port)
311static struct tty_struct * 311static struct tty_struct *
312receive_chars(struct uart_sunsu_port *up, unsigned char *status) 312receive_chars(struct uart_sunsu_port *up, unsigned char *status)
313{ 313{
314 struct tty_struct *tty = up->port.info->tty; 314 struct tty_struct *tty = up->port.info->port.tty;
315 unsigned char ch, flag; 315 unsigned char ch, flag;
316 int max_count = 256; 316 int max_count = 256;
317 int saw_console_brk = 0; 317 int saw_console_brk = 0;
diff --git a/drivers/serial/sunzilog.c b/drivers/serial/sunzilog.c
index 7e9fa5ef0eb7..0f3d69b86d67 100644
--- a/drivers/serial/sunzilog.c
+++ b/drivers/serial/sunzilog.c
@@ -329,8 +329,8 @@ sunzilog_receive_chars(struct uart_sunzilog_port *up,
329 329
330 tty = NULL; 330 tty = NULL;
331 if (up->port.info != NULL && /* Unopened serial console */ 331 if (up->port.info != NULL && /* Unopened serial console */
332 up->port.info->tty != NULL) /* Keyboard || mouse */ 332 up->port.info->port.tty != NULL) /* Keyboard || mouse */
333 tty = up->port.info->tty; 333 tty = up->port.info->port.tty;
334 334
335 for (;;) { 335 for (;;) {
336 336
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index b51c24245be4..6a3f8fb0c9dd 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -75,7 +75,7 @@ static struct uart_port ulite_ports[ULITE_NR_UARTS];
75 75
76static int ulite_receive(struct uart_port *port, int stat) 76static int ulite_receive(struct uart_port *port, int stat)
77{ 77{
78 struct tty_struct *tty = port->info->tty; 78 struct tty_struct *tty = port->info->port.tty;
79 unsigned char ch = 0; 79 unsigned char ch = 0;
80 char flag = TTY_NORMAL; 80 char flag = TTY_NORMAL;
81 81
@@ -162,7 +162,7 @@ static irqreturn_t ulite_isr(int irq, void *dev_id)
162 busy |= ulite_transmit(port, stat); 162 busy |= ulite_transmit(port, stat);
163 } while (busy); 163 } while (busy);
164 164
165 tty_flip_buffer_push(port->info->tty); 165 tty_flip_buffer_push(port->info->port.tty);
166 166
167 return IRQ_HANDLED; 167 return IRQ_HANDLED;
168} 168}
diff --git a/drivers/serial/ucc_uart.c b/drivers/serial/ucc_uart.c
index 566a8b42e05a..5c5d18dcb6ac 100644
--- a/drivers/serial/ucc_uart.c
+++ b/drivers/serial/ucc_uart.c
@@ -466,7 +466,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port)
466 int i; 466 int i;
467 unsigned char ch, *cp; 467 unsigned char ch, *cp;
468 struct uart_port *port = &qe_port->port; 468 struct uart_port *port = &qe_port->port;
469 struct tty_struct *tty = port->info->tty; 469 struct tty_struct *tty = port->info->port.tty;
470 struct qe_bd *bdp; 470 struct qe_bd *bdp;
471 u16 status; 471 u16 status;
472 unsigned int flg; 472 unsigned int flg;
diff --git a/drivers/serial/v850e_uart.c b/drivers/serial/v850e_uart.c
index dd98aca6ed08..5acf061b6cd2 100644
--- a/drivers/serial/v850e_uart.c
+++ b/drivers/serial/v850e_uart.c
@@ -300,8 +300,8 @@ static irqreturn_t v850e_uart_rx_irq(int irq, void *data)
300 300
301 port->icount.rx++; 301 port->icount.rx++;
302 302
303 tty_insert_flip_char (port->info->tty, ch, ch_stat); 303 tty_insert_flip_char (port->info->port.tty, ch, ch_stat);
304 tty_schedule_flip (port->info->tty); 304 tty_schedule_flip (port->info->port.tty);
305 305
306 return IRQ_HANDLED; 306 return IRQ_HANDLED;
307} 307}
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index bb6ce6bba32f..0573f3b5175e 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -318,7 +318,7 @@ static inline void receive_chars(struct uart_port *port, uint8_t *status)
318 char flag; 318 char flag;
319 int max_count = RX_MAX_COUNT; 319 int max_count = RX_MAX_COUNT;
320 320
321 tty = port->info->tty; 321 tty = port->info->port.tty;
322 lsr = *status; 322 lsr = *status;
323 323
324 do { 324 do {
diff --git a/drivers/serial/zs.c b/drivers/serial/zs.c
index 65f1294fd27b..bd45b6230fd8 100644
--- a/drivers/serial/zs.c
+++ b/drivers/serial/zs.c
@@ -602,7 +602,7 @@ static void zs_receive_chars(struct zs_port *zport)
602 uart_insert_char(uport, status, Rx_OVR, ch, flag); 602 uart_insert_char(uport, status, Rx_OVR, ch, flag);
603 } 603 }
604 604
605 tty_flip_buffer_push(uport->info->tty); 605 tty_flip_buffer_push(uport->info->port.tty);
606} 606}
607 607
608static void zs_raw_transmit_chars(struct zs_port *zport) 608static void zs_raw_transmit_chars(struct zs_port *zport)