Commit a88487c7 authored by Takashi Iwai's avatar Takashi Iwai Committed by Linus Torvalds

Fix compile errors in SGI console drivers (linux-next tree)

The below is the patch to replace blindly all possible places,
including Jack's fixes.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
(Reviewed and checked rather than blindly added)
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b1ca7e7a
...@@ -86,7 +86,7 @@ static void serial21285_enable_ms(struct uart_port *port) ...@@ -86,7 +86,7 @@ static void serial21285_enable_ms(struct uart_port *port)
static irqreturn_t serial21285_rx_chars(int irq, void *dev_id) static irqreturn_t serial21285_rx_chars(int irq, void *dev_id)
{ {
struct uart_port *port = dev_id; struct uart_port *port = dev_id;
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
unsigned int status, ch, flag, rxs, max_count = 256; unsigned int status, ch, flag, rxs, max_count = 256;
status = *CSR_UARTFLG; status = *CSR_UARTFLG;
...@@ -235,8 +235,8 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -235,8 +235,8 @@ serial21285_set_termios(struct uart_port *port, struct ktermios *termios,
baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16);
quot = uart_get_divisor(port, baud); quot = uart_get_divisor(port, baud);
if (port->info && port->info->tty) { if (port->info && port->info->port.tty) {
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
unsigned int b = port->uartclk / (16 * quot); unsigned int b = port->uartclk / (16 * quot);
tty_encode_baud_rate(tty, b, b); tty_encode_baud_rate(tty, b, b);
} }
......
...@@ -249,7 +249,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status) ...@@ -249,7 +249,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status)
{ {
#if 0 #if 0
if(status & DCD) { if(status & DCD) {
if((info->tty->termios->c_cflag & CRTSCTS) && if((info->port.tty->termios->c_cflag & CRTSCTS) &&
((info->curregs[3] & AUTO_ENAB)==0)) { ((info->curregs[3] & AUTO_ENAB)==0)) {
info->curregs[3] |= AUTO_ENAB; info->curregs[3] |= AUTO_ENAB;
info->pendregs[3] |= AUTO_ENAB; info->pendregs[3] |= AUTO_ENAB;
...@@ -274,7 +274,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status) ...@@ -274,7 +274,7 @@ static void status_handle(struct m68k_serial *info, unsigned short status)
static void receive_chars(struct m68k_serial *info, unsigned short rx) static void receive_chars(struct m68k_serial *info, unsigned short rx)
{ {
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
m68328_uart *uart = &uart_addr[info->line]; m68328_uart *uart = &uart_addr[info->line];
unsigned char ch, flag; unsigned char ch, flag;
...@@ -345,7 +345,7 @@ static void transmit_chars(struct m68k_serial *info) ...@@ -345,7 +345,7 @@ static void transmit_chars(struct m68k_serial *info)
goto clear_and_return; goto clear_and_return;
} }
if((info->xmit_cnt <= 0) || info->tty->stopped) { if((info->xmit_cnt <= 0) || info->port.tty->stopped) {
/* That's peculiar... TX ints off */ /* That's peculiar... TX ints off */
uart->ustcnt &= ~USTCNT_TX_INTR_MASK; uart->ustcnt &= ~USTCNT_TX_INTR_MASK;
goto clear_and_return; goto clear_and_return;
...@@ -403,7 +403,7 @@ static void do_softint(struct work_struct *work) ...@@ -403,7 +403,7 @@ static void do_softint(struct work_struct *work)
struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue); struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue);
struct tty_struct *tty; struct tty_struct *tty;
tty = info->tty; tty = info->port.tty;
if (!tty) if (!tty)
return; return;
#if 0 #if 0
...@@ -427,7 +427,7 @@ static void do_serial_hangup(struct work_struct *work) ...@@ -427,7 +427,7 @@ static void do_serial_hangup(struct work_struct *work)
struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup); struct m68k_serial *info = container_of(work, struct m68k_serial, tqueue_hangup);
struct tty_struct *tty; struct tty_struct *tty;
tty = info->tty; tty = info->port.tty;
if (!tty) if (!tty)
return; return;
...@@ -471,8 +471,8 @@ static int startup(struct m68k_serial * info) ...@@ -471,8 +471,8 @@ static int startup(struct m68k_serial * info)
uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK; uart->ustcnt = USTCNT_UEN | USTCNT_RXEN | USTCNT_RX_INTR_MASK;
#endif #endif
if (info->tty) if (info->port.tty)
clear_bit(TTY_IO_ERROR, &info->tty->flags); clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
/* /*
...@@ -506,8 +506,8 @@ static void shutdown(struct m68k_serial * info) ...@@ -506,8 +506,8 @@ static void shutdown(struct m68k_serial * info)
info->xmit_buf = 0; info->xmit_buf = 0;
} }
if (info->tty) if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->tty->flags); set_bit(TTY_IO_ERROR, &info->port.tty->flags);
info->flags &= ~S_INITIALIZED; info->flags &= ~S_INITIALIZED;
local_irq_restore(flags); local_irq_restore(flags);
...@@ -573,9 +573,9 @@ static void change_speed(struct m68k_serial *info) ...@@ -573,9 +573,9 @@ static void change_speed(struct m68k_serial *info)
unsigned cflag; unsigned cflag;
int i; int i;
if (!info->tty || !info->tty->termios) if (!info->port.tty || !info->port.tty->termios)
return; return;
cflag = info->tty->termios->c_cflag; cflag = info->port.tty->termios->c_cflag;
if (!(port = info->port)) if (!(port = info->port))
return; return;
...@@ -1131,7 +1131,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) ...@@ -1131,7 +1131,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
tty_ldisc_flush(tty); tty_ldisc_flush(tty);
tty->closing = 0; tty->closing = 0;
info->event = 0; info->event = 0;
info->tty = 0; info->port.tty = NULL;
#warning "This is not and has never been valid so fix it" #warning "This is not and has never been valid so fix it"
#if 0 #if 0
if (tty->ldisc.num != ldiscs[N_TTY].num) { if (tty->ldisc.num != ldiscs[N_TTY].num) {
...@@ -1169,7 +1169,7 @@ void rs_hangup(struct tty_struct *tty) ...@@ -1169,7 +1169,7 @@ void rs_hangup(struct tty_struct *tty)
info->event = 0; info->event = 0;
info->count = 0; info->count = 0;
info->flags &= ~S_NORMAL_ACTIVE; info->flags &= ~S_NORMAL_ACTIVE;
info->tty = 0; info->port.tty = NULL;
wake_up_interruptible(&info->open_wait); wake_up_interruptible(&info->open_wait);
} }
...@@ -1286,7 +1286,7 @@ int rs_open(struct tty_struct *tty, struct file * filp) ...@@ -1286,7 +1286,7 @@ int rs_open(struct tty_struct *tty, struct file * filp)
info->count++; info->count++;
tty->driver_data = info; tty->driver_data = info;
info->tty = tty; info->port.tty = tty;
/* /*
* Start up serial port * Start up serial port
...@@ -1363,7 +1363,7 @@ rs68328_init(void) ...@@ -1363,7 +1363,7 @@ rs68328_init(void)
info = &m68k_soft[i]; info = &m68k_soft[i];
info->magic = SERIAL_MAGIC; info->magic = SERIAL_MAGIC;
info->port = (int) &uart_addr[i]; info->port = (int) &uart_addr[i];
info->tty = 0; info->port.tty = NULL;
info->irq = uart_irqs[i]; info->irq = uart_irqs[i];
info->custom_divisor = 16; info->custom_divisor = 16;
info->close_delay = 50; info->close_delay = 50;
......
...@@ -393,7 +393,7 @@ static void rs_360_start(struct tty_struct *tty) ...@@ -393,7 +393,7 @@ static void rs_360_start(struct tty_struct *tty)
static _INLINE_ void receive_chars(ser_info_t *info) static _INLINE_ void receive_chars(ser_info_t *info)
{ {
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
unsigned char ch, flag, *cp; unsigned char ch, flag, *cp;
/*int ignored = 0;*/ /*int ignored = 0;*/
int i; int i;
...@@ -514,7 +514,7 @@ static _INLINE_ void receive_chars(ser_info_t *info) ...@@ -514,7 +514,7 @@ static _INLINE_ void receive_chars(ser_info_t *info)
static _INLINE_ void receive_break(ser_info_t *info) static _INLINE_ void receive_break(ser_info_t *info)
{ {
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
info->state->icount.brk++; info->state->icount.brk++;
/* Check to see if there is room in the tty buffer for /* 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,7 +528,7 @@ static _INLINE_ void transmit_chars(ser_info_t *info)
{ {
if ((info->flags & TX_WAKEUP) || if ((info->flags & TX_WAKEUP) ||
(info->tty->flags & (1 << TTY_DO_WRITE_WAKEUP))) { (info->port.tty->flags & (1 << TTY_DO_WRITE_WAKEUP))) {
schedule_work(&info->tqueue); schedule_work(&info->tqueue);
} }
...@@ -584,12 +584,12 @@ static _INLINE_ void check_modem_status(struct async_struct *info) ...@@ -584,12 +584,12 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
} }
} }
if (info->flags & ASYNC_CTS_FLOW) { if (info->flags & ASYNC_CTS_FLOW) {
if (info->tty->hw_stopped) { if (info->port.tty->hw_stopped) {
if (status & UART_MSR_CTS) { if (status & UART_MSR_CTS) {
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) #if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
printk("CTS tx start..."); printk("CTS tx start...");
#endif #endif
info->tty->hw_stopped = 0; info->port.tty->hw_stopped = 0;
info->IER |= UART_IER_THRI; info->IER |= UART_IER_THRI;
serial_out(info, UART_IER, info->IER); serial_out(info, UART_IER, info->IER);
rs_sched_event(info, RS_EVENT_WRITE_WAKEUP); rs_sched_event(info, RS_EVENT_WRITE_WAKEUP);
...@@ -600,7 +600,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info) ...@@ -600,7 +600,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) #if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
printk("CTS tx stop..."); printk("CTS tx stop...");
#endif #endif
info->tty->hw_stopped = 1; info->port.tty->hw_stopped = 1;
info->IER &= ~UART_IER_THRI; info->IER &= ~UART_IER_THRI;
serial_out(info, UART_IER, info->IER); serial_out(info, UART_IER, info->IER);
} }
...@@ -670,7 +670,7 @@ static void do_softint(void *private_) ...@@ -670,7 +670,7 @@ static void do_softint(void *private_)
ser_info_t *info = (ser_info_t *) private_; ser_info_t *info = (ser_info_t *) private_;
struct tty_struct *tty; struct tty_struct *tty;
tty = info->tty; tty = info->port.tty;
if (!tty) if (!tty)
return; return;
...@@ -693,7 +693,7 @@ static void do_serial_hangup(void *private_) ...@@ -693,7 +693,7 @@ static void do_serial_hangup(void *private_)
struct async_struct *info = (struct async_struct *) private_; struct async_struct *info = (struct async_struct *) private_;
struct tty_struct *tty; struct tty_struct *tty;
tty = info->tty; tty = info->port.tty;
if (!tty) if (!tty)
return; return;
...@@ -721,8 +721,8 @@ static int startup(ser_info_t *info) ...@@ -721,8 +721,8 @@ static int startup(ser_info_t *info)
#ifdef maybe #ifdef maybe
if (!state->port || !state->type) { if (!state->port || !state->type) {
if (info->tty) if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->tty->flags); set_bit(TTY_IO_ERROR, &info->port.tty->flags);
goto errout; goto errout;
} }
#endif #endif
...@@ -734,12 +734,12 @@ static int startup(ser_info_t *info) ...@@ -734,12 +734,12 @@ static int startup(ser_info_t *info)
#ifdef modem_control #ifdef modem_control
info->MCR = 0; info->MCR = 0;
if (info->tty->termios->c_cflag & CBAUD) if (info->port.tty->termios->c_cflag & CBAUD)
info->MCR = UART_MCR_DTR | UART_MCR_RTS; info->MCR = UART_MCR_DTR | UART_MCR_RTS;
#endif #endif
if (info->tty) if (info->port.tty)
clear_bit(TTY_IO_ERROR, &info->tty->flags); clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
/* /*
* and set the speed of the serial port * and set the speed of the serial port
...@@ -842,8 +842,8 @@ static void shutdown(ser_info_t *info) ...@@ -842,8 +842,8 @@ static void shutdown(ser_info_t *info)
smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN); smcp->smc_smcmr &= ~(SMCMR_REN | SMCMR_TEN);
} }
if (info->tty) if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->tty->flags); set_bit(TTY_IO_ERROR, &info->port.tty->flags);
info->flags &= ~ASYNC_INITIALIZED; info->flags &= ~ASYNC_INITIALIZED;
local_irq_restore(flags); local_irq_restore(flags);
...@@ -863,9 +863,9 @@ static void change_speed(ser_info_t *info) ...@@ -863,9 +863,9 @@ static void change_speed(ser_info_t *info)
volatile struct smc_regs *smcp; volatile struct smc_regs *smcp;
volatile struct scc_regs *sccp; volatile struct scc_regs *sccp;
if (!info->tty || !info->tty->termios) if (!info->port.tty || !info->port.tty->termios)
return; return;
cflag = info->tty->termios->c_cflag; cflag = info->port.tty->termios->c_cflag;
state = info->state; state = info->state;
...@@ -936,24 +936,24 @@ static void change_speed(ser_info_t *info) ...@@ -936,24 +936,24 @@ static void change_speed(ser_info_t *info)
* Set up parity check flag * Set up parity check flag
*/ */
info->read_status_mask = (BD_SC_EMPTY | BD_SC_OV); info->read_status_mask = (BD_SC_EMPTY | BD_SC_OV);
if (I_INPCK(info->tty)) if (I_INPCK(info->port.tty))
info->read_status_mask |= BD_SC_FR | BD_SC_PR; info->read_status_mask |= BD_SC_FR | BD_SC_PR;
if (I_BRKINT(info->tty) || I_PARMRK(info->tty)) if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty))
info->read_status_mask |= BD_SC_BR; info->read_status_mask |= BD_SC_BR;
/* /*
* Characters to ignore * Characters to ignore
*/ */
info->ignore_status_mask = 0; info->ignore_status_mask = 0;
if (I_IGNPAR(info->tty)) if (I_IGNPAR(info->port.tty))
info->ignore_status_mask |= BD_SC_PR | BD_SC_FR; info->ignore_status_mask |= BD_SC_PR | BD_SC_FR;
if (I_IGNBRK(info->tty)) { if (I_IGNBRK(info->port.tty)) {
info->ignore_status_mask |= BD_SC_BR; info->ignore_status_mask |= BD_SC_BR;
/* /*
* If we're ignore parity and break indicators, ignore * If we're ignore parity and break indicators, ignore
* overruns too. (For real raw support). * overruns too. (For real raw support).
*/ */
if (I_IGNPAR(info->tty)) if (I_IGNPAR(info->port.tty))
info->ignore_status_mask |= BD_SC_OV; info->ignore_status_mask |= BD_SC_OV;
} }
/* /*
...@@ -1658,7 +1658,7 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) ...@@ -1658,7 +1658,7 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
tty_ldisc_flush(tty); tty_ldisc_flush(tty);
tty->closing = 0; tty->closing = 0;
info->event = 0; info->event = 0;
info->tty = 0; info->port.tty = NULL;
if (info->blocked_open) { if (info->blocked_open) {
if (info->close_delay) { if (info->close_delay) {
msleep_interruptible(jiffies_to_msecs(info->close_delay)); msleep_interruptible(jiffies_to_msecs(info->close_delay));
...@@ -1758,7 +1758,7 @@ static void rs_360_hangup(struct tty_struct *tty) ...@@ -1758,7 +1758,7 @@ static void rs_360_hangup(struct tty_struct *tty)
info->event = 0; info->event = 0;
state->count = 0; state->count = 0;
info->flags &= ~ASYNC_NORMAL_ACTIVE; info->flags &= ~ASYNC_NORMAL_ACTIVE;
info->tty = 0; info->port.tty = NULL;
wake_up_interruptible(&info->open_wait); wake_up_interruptible(&info->open_wait);
} }
...@@ -1919,7 +1919,7 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp) ...@@ -1919,7 +1919,7 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp)
printk("rs_open %s, count = %d\n", tty->name, info->state->count); printk("rs_open %s, count = %d\n", tty->name, info->state->count);
#endif #endif
tty->driver_data = info; tty->driver_data = info;
info->tty = tty; info->port.tty = tty;
/* /*
* Start up serial port * Start up serial port
...@@ -1976,7 +1976,7 @@ static inline int line_info(char *buf, struct serial_state *state) ...@@ -1976,7 +1976,7 @@ static inline int line_info(char *buf, struct serial_state *state)
info->port = state->port; info->port = state->port;
info->flags = state->flags; info->flags = state->flags;
info->quot = 0; info->quot = 0;
info->tty = 0; info->port.tty = NULL;
} }
local_irq_disable(); local_irq_disable();
status = serial_in(info, UART_MSR); status = serial_in(info, UART_MSR);
......
...@@ -117,7 +117,7 @@ static void pl010_enable_ms(struct uart_port *port) ...@@ -117,7 +117,7 @@ static void pl010_enable_ms(struct uart_port *port)
static void pl010_rx_chars(struct uart_amba_port *uap) static void pl010_rx_chars(struct uart_amba_port *uap)
{ {
struct tty_struct *tty = uap->port.info->tty; struct tty_struct *tty = uap->port.info->port.tty;
unsigned int status, ch, flag, rsr, max_count = 256; unsigned int status, ch, flag, rsr, max_count = 256;
status = readb(uap->port.membase + UART01x_FR); status = readb(uap->port.membase + UART01x_FR);
......
...@@ -107,7 +107,7 @@ static void pl011_enable_ms(struct uart_port *port) ...@@ -107,7 +107,7 @@ static void pl011_enable_ms(struct uart_port *port)
static void pl011_rx_chars(struct uart_amba_port *uap) static void pl011_rx_chars(struct uart_amba_port *uap)
{ {
struct tty_struct *tty = uap->port.info->tty; struct tty_struct *tty = uap->port.info->port.tty;
unsigned int status, ch, flag, max_count = 256; unsigned int status, ch, flag, max_count = 256;
status = readw(uap->port.membase + UART01x_FR); status = readw(uap->port.membase + UART01x_FR);
......
...@@ -175,7 +175,7 @@ int kgdb_get_debug_char(void) ...@@ -175,7 +175,7 @@ int kgdb_get_debug_char(void)
#ifdef CONFIG_SERIAL_BFIN_PIO #ifdef CONFIG_SERIAL_BFIN_PIO
static void bfin_serial_rx_chars(struct bfin_serial_port *uart) static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
{ {
struct tty_struct *tty = uart->port.info->tty; struct tty_struct *tty = uart->port.info->port.tty;
unsigned int status, ch, flg; unsigned int status, ch, flg;
static struct timeval anomaly_start = { .tv_sec = 0 }; static struct timeval anomaly_start = { .tv_sec = 0 };
...@@ -393,7 +393,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) ...@@ -393,7 +393,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart)
{ {
struct tty_struct *tty = uart->port.info->tty; struct tty_struct *tty = uart->port.info->port.tty;
int i, flg, status; int i, flg, status;
status = UART_GET_LSR(uart); status = UART_GET_LSR(uart);
...@@ -552,7 +552,7 @@ static void bfin_serial_mctrl_check(struct bfin_serial_port *uart) ...@@ -552,7 +552,7 @@ static void bfin_serial_mctrl_check(struct bfin_serial_port *uart)
#ifdef CONFIG_SERIAL_BFIN_CTSRTS #ifdef CONFIG_SERIAL_BFIN_CTSRTS
unsigned int status; unsigned int status;
struct uart_info *info = uart->port.info; struct uart_info *info = uart->port.info;
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
status = bfin_serial_get_mctrl(&uart->port); status = bfin_serial_get_mctrl(&uart->port);
uart_handle_cts_change(&uart->port, status & TIOCM_CTS); uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
...@@ -814,10 +814,10 @@ static void bfin_serial_set_ldisc(struct uart_port *port) ...@@ -814,10 +814,10 @@ static void bfin_serial_set_ldisc(struct uart_port *port)
int line = port->line; int line = port->line;
unsigned short val; unsigned short val;
if (line >= port->info->tty->driver->num) if (line >= port->info->port.tty->driver->num)
return; return;
switch (port->info->tty->ldisc.num) { switch (port->info->port.tty->ldisc.num) {
case N_IRDA: case N_IRDA:
val = UART_GET_GCTL(&bfin_serial_ports[line]); val = UART_GET_GCTL(&bfin_serial_ports[line]);
val |= (IREN | RPOLC); val |= (IREN | RPOLC);
......
...@@ -174,7 +174,7 @@ static int sport_uart_setup(struct sport_uart_port *up, int sclk, int baud_rate) ...@@ -174,7 +174,7 @@ static int sport_uart_setup(struct sport_uart_port *up, int sclk, int baud_rate)
static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id) static irqreturn_t sport_uart_rx_irq(int irq, void *dev_id)
{ {
struct sport_uart_port *up = dev_id; struct sport_uart_port *up = dev_id;
struct tty_struct *tty = up->port.info->tty; struct tty_struct *tty = up->port.info->port.tty;
unsigned int ch; unsigned int ch;
do { do {
...@@ -201,7 +201,7 @@ static irqreturn_t sport_uart_tx_irq(int irq, void *dev_id) ...@@ -201,7 +201,7 @@ static irqreturn_t sport_uart_tx_irq(int irq, void *dev_id)
static irqreturn_t sport_uart_err_irq(int irq, void *dev_id) static irqreturn_t sport_uart_err_irq(int irq, void *dev_id)
{ {
struct sport_uart_port *up = dev_id; struct sport_uart_port *up = dev_id;
struct tty_struct *tty = up->port.info->tty; struct tty_struct *tty = up->port.info->port.tty;
unsigned int stat = SPORT_GET_STAT(up); unsigned int stat = SPORT_GET_STAT(up);
/* Overflow in RX FIFO */ /* Overflow in RX FIFO */
......
...@@ -93,7 +93,7 @@ static void clps711xuart_enable_ms(struct uart_port *port) ...@@ -93,7 +93,7 @@ static void clps711xuart_enable_ms(struct uart_port *port)
static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id) static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id)
{ {
struct uart_port *port = dev_id; struct uart_port *port = dev_id;
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
unsigned int status, ch, flg; unsigned int status, ch, flg;
status = clps_readl(SYSFLG(port)); status = clps_readl(SYSFLG(port));
......
...@@ -968,7 +968,7 @@ static DEFINE_MUTEX(tmp_buf_mutex); ...@@ -968,7 +968,7 @@ static DEFINE_MUTEX(tmp_buf_mutex);
/* Calculate the chartime depending on baudrate, numbor of bits etc. */ /* Calculate the chartime depending on baudrate, numbor of bits etc. */
static void update_char_time(struct e100_serial * info) static void update_char_time(struct e100_serial * info)
{ {
tcflag_t cflags = info->tty->termios->c_cflag; tcflag_t cflags = info->port.tty->termios->c_cflag;
int bits; int bits;
/* calc. number of bits / data byte */ /* calc. number of bits / data byte */
...@@ -1483,7 +1483,8 @@ rs_stop(struct tty_struct *tty) ...@@ -1483,7 +1483,8 @@ rs_stop(struct tty_struct *tty)
CIRC_CNT(info->xmit.head, CIRC_CNT(info->xmit.head,
info->xmit.tail,SERIAL_XMIT_SIZE))); info->xmit.tail,SERIAL_XMIT_SIZE)));
xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->tty)); xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char,
STOP_CHAR(info->port.tty));
xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, stop); xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, stop);
if (tty->termios->c_iflag & IXON ) { if (tty->termios->c_iflag & IXON ) {
xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); 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,7 +1773,7 @@ add_char_and_flag(struct e100_serial *info, unsigned char data, unsigned char fl
info->icount.rx++; info->icount.rx++;
} else { } else {
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
tty_insert_flip_char(tty, data, flag); tty_insert_flip_char(tty, data, flag);
info->icount.rx++; info->icount.rx++;
} }
...@@ -1838,7 +1839,7 @@ static unsigned int handle_all_descr_data(struct e100_serial *info) ...@@ -1838,7 +1839,7 @@ static unsigned int handle_all_descr_data(struct e100_serial *info)
descr->status = 0; descr->status = 0;
DFLOW( DEBUG_LOG(info->line, "RX %lu\n", recvl); DFLOW( DEBUG_LOG(info->line, "RX %lu\n", recvl);
if (info->tty->stopped) { if (info->port.tty->stopped) {
unsigned char *buf = phys_to_virt(descr->buf); unsigned char *buf = phys_to_virt(descr->buf);
DEBUG_LOG(info->line, "rx 0x%02X\n", buf[0]); DEBUG_LOG(info->line, "rx 0x%02X\n", buf[0]);
DEBUG_LOG(info->line, "rx 0x%02X\n", buf[1]); DEBUG_LOG(info->line, "rx 0x%02X\n", buf[1]);
...@@ -1872,7 +1873,7 @@ static void receive_chars_dma(struct e100_serial *info) ...@@ -1872,7 +1873,7 @@ static void receive_chars_dma(struct e100_serial *info)
IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) | IO_STATE(R_DMA_CH6_CLR_INTR, clr_descr, do) |
IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do); IO_STATE(R_DMA_CH6_CLR_INTR, clr_eop, do);
tty = info->tty; tty = info->port.tty;
if (!tty) /* Something wrong... */ if (!tty) /* Something wrong... */
return; return;
...@@ -2122,7 +2123,7 @@ static void flush_to_flip_buffer(struct e100_serial *info) ...@@ -2122,7 +2123,7 @@ static void flush_to_flip_buffer(struct e100_serial *info)
unsigned long flags; unsigned long flags;
local_irq_save(flags); local_irq_save(flags);
tty = info->tty; tty = info->port.tty;
if (!tty) { if (!tty) {
local_irq_restore(flags); local_irq_restore(flags);
...@@ -2287,7 +2288,7 @@ static ...@@ -2287,7 +2288,7 @@ static
struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info) struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info)
{ {
unsigned long data_read; unsigned long data_read;
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
if (!tty) { if (!tty) {
printk("!NO TTY!\n"); printk("!NO TTY!\n");
...@@ -2350,7 +2351,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info) ...@@ -2350,7 +2351,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info)
data_in, data_read); data_in, data_read);
char flag = TTY_NORMAL; char flag = TTY_NORMAL;
if (info->errorcode == ERRCODE_INSERT_BREAK) { if (info->errorcode == ERRCODE_INSERT_BREAK) {
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
tty_insert_flip_char(tty, 0, flag); tty_insert_flip_char(tty, 0, flag);
info->icount.rx++; info->icount.rx++;
} }
...@@ -2396,7 +2397,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info) ...@@ -2396,7 +2397,7 @@ struct e100_serial * handle_ser_rx_interrupt_no_dma(struct e100_serial *info)
goto more_data; goto more_data;
} }
tty_flip_buffer_push(info->tty); tty_flip_buffer_push(info->port.tty);
return info; return info;
} }
...@@ -2547,8 +2548,8 @@ static void handle_ser_tx_interrupt(struct e100_serial *info) ...@@ -2547,8 +2548,8 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
rstat = info->port[REG_STATUS]; rstat = info->port[REG_STATUS];
DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat)); DFLOW(DEBUG_LOG(info->line, "stat %x\n", rstat));
e100_disable_serial_tx_ready_irq(info); e100_disable_serial_tx_ready_irq(info);
if (info->tty->stopped) if (info->port.tty->stopped)
rs_stop(info->tty); rs_stop(info->port.tty);
/* Enable the DMA channel and tell it to continue */ /* Enable the DMA channel and tell it to continue */
e100_enable_txdma_channel(info); e100_enable_txdma_channel(info);
/* Wait 12 cycles before doing the DMA command */ /* Wait 12 cycles before doing the DMA command */
...@@ -2561,9 +2562,10 @@ static void handle_ser_tx_interrupt(struct e100_serial *info) ...@@ -2561,9 +2562,10 @@ static void handle_ser_tx_interrupt(struct e100_serial *info)
} }
/* Normal char-by-char interrupt */ /* Normal char-by-char interrupt */
if (info->xmit.head == info->xmit.tail if (info->xmit.head == info->xmit.tail
|| info->tty->stopped || info->port.tty->stopped
|| info->tty->hw_stopped) { || info->port.tty->hw_stopped) {
DFLOW(DEBUG_LOG(info->line, "tx_int: stopped %i\n", info->tty->stopped)); DFLOW(DEBUG_LOG(info->line, "tx_int: stopped %i\n",
info->port.tty->stopped));
e100_disable_serial_tx_ready_irq(info); e100_disable_serial_tx_ready_irq(info);
info->tr_running = 0; info->tr_running = 0;
return; return;
...@@ -2725,7 +2727,7 @@ do_softint(struct work_struct *work) ...@@ -2725,7 +2727,7 @@ do_softint(struct work_struct *work)
info = container_of(work, struct e100_serial, work); info = container_of(work, struct e100_serial, work);
tty = info->tty; tty = info->port.tty;
if (!tty) if (!tty)
return; return;
...@@ -2767,8 +2769,8 @@ startup(struct e100_serial * info) ...@@ -2767,8 +2769,8 @@ startup(struct e100_serial * info)
/* Bits and pieces collected from below. Better to have them /* Bits and pieces collected from below. Better to have them
in one ifdef:ed clause than to mix in a lot of ifdefs, in one ifdef:ed clause than to mix in a lot of ifdefs,
right? */ right? */
if (info->tty) if (info->port.tty)
clear_bit(TTY_IO_ERROR, &info->tty->flags); clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
info->xmit.head = info->xmit.tail = 0; info->xmit.head = info->xmit.tail = 0;
info->first_recv_buffer = info->last_recv_buffer = NULL; info->first_recv_buffer = info->last_recv_buffer = NULL;
...@@ -2825,8 +2827,8 @@ startup(struct e100_serial * info) ...@@ -2825,8 +2827,8 @@ startup(struct e100_serial * info)
e100_disable_txdma_channel(info); e100_disable_txdma_channel(info);
} }
if (info->tty) if (info->port.tty)
clear_bit(TTY_IO_ERROR, &info->tty->flags); clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
info->xmit.head = info->xmit.tail = 0; info->xmit.head = info->xmit.tail = 0;
info->first_recv_buffer = info->last_recv_buffer = NULL; info->first_recv_buffer = info->last_recv_buffer = NULL;
...@@ -2940,14 +2942,14 @@ shutdown(struct e100_serial * info) ...@@ -2940,14 +2942,14 @@ shutdown(struct e100_serial * info)
descr[i].buf = 0; descr[i].buf = 0;
} }
if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) { if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL)) {
/* hang up DTR and RTS if HUPCL is enabled */ /* hang up DTR and RTS if HUPCL is enabled */
e100_dtr(info, 0); e100_dtr(info, 0);
e100_rts(info, 0); /* could check CRTSCTS before doing this */ e100_rts(info, 0); /* could check CRTSCTS before doing this */
} }
if (info->tty) if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->tty->flags); set_bit(TTY_IO_ERROR, &info->port.tty->flags);
info->flags &= ~ASYNC_INITIALIZED; info->flags &= ~ASYNC_INITIALIZED;
local_irq_restore(flags); local_irq_restore(flags);
...@@ -2964,12 +2966,12 @@ change_speed(struct e100_serial *info) ...@@ -2964,12 +2966,12 @@ change_speed(struct e100_serial *info)
unsigned long flags; unsigned long flags;
/* first some safety checks */ /* first some safety checks */
if (!info->tty || !info->tty->termios) if (!info->port.tty || !info->port.tty->termios)
return; return;
if (!info->port) if (!info->port)
return; return;
cflag = info->tty->termios->c_cflag; cflag = info->port.tty->termios->c_cflag;
/* possibly, the tx/rx should be disabled first to do this safely */ /* possibly, the tx/rx should be disabled first to do this safely */
...@@ -3097,10 +3099,11 @@ change_speed(struct e100_serial *info) ...@@ -3097,10 +3099,11 @@ change_speed(struct e100_serial *info)
info->port[REG_TR_CTRL] = info->tx_ctrl; info->port[REG_TR_CTRL] = info->tx_ctrl;
info->port[REG_REC_CTRL] = info->rx_ctrl; info->port[REG_REC_CTRL] = info->rx_ctrl;
xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->tty)); xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty));
xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable); xoff |= IO_STATE(R_SERIAL0_XOFF, tx_stop, enable);
if (info->tty->termios->c_iflag & IXON ) { if (info->port.tty->termios->c_iflag & IXON ) {
DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n", STOP_CHAR(info->tty))); DFLOW(DEBUG_LOG(info->line, "FLOW XOFF enabled 0x%02X\n",
STOP_CHAR(info->port.tty)));
xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable); xoff |= IO_STATE(R_SERIAL0_XOFF, auto_xoff, enable);
} }
...@@ -3475,7 +3478,7 @@ set_serial_info(struct e100_serial *info, ...@@ -3475,7 +3478,7 @@ set_serial_info(struct e100_serial *info,
info->type = new_serial.type; info->type = new_serial.type;
info->close_delay = new_serial.close_delay; info->close_delay = new_serial.close_delay;
info->closing_wait = new_serial.closing_wait; info->closing_wait = new_serial.closing_wait;
info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; info->port.tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
check_and_exit: check_and_exit:
if (info->flags & ASYNC_INITIALIZED) { if (info->flags & ASYNC_INITIALIZED) {
...@@ -3811,7 +3814,7 @@ rs_close(struct tty_struct *tty, struct file * filp) ...@@ -3811,7 +3814,7 @@ rs_close(struct tty_struct *tty, struct file * filp)
tty_ldisc_flush(tty); tty_ldisc_flush(tty);
tty->closing = 0; tty->closing = 0;
info->event = 0; info->event = 0;
info->tty = 0; info->port.tty = NULL;
if (info->blocked_open) { if (info->blocked_open) {
if (info->close_delay) if (info->close_delay)
schedule_timeout_interruptible(info->close_delay); schedule_timeout_interruptible(info->close_delay);
...@@ -3915,7 +3918,7 @@ rs_hangup(struct tty_struct *tty) ...@@ -3915,7 +3918,7 @@ rs_hangup(struct tty_struct *tty)
info->event = 0; info->event = 0;
info->count = 0; info->count = 0;
info->flags &= ~ASYNC_NORMAL_ACTIVE; info->flags &= ~ASYNC_NORMAL_ACTIVE;
info->tty = 0; info->port.tty = NULL;
wake_up_interruptible(&info->open_wait); wake_up_interruptible(&info->open_wait);
} }
...@@ -4077,9 +4080,9 @@ rs_open(struct tty_struct *tty, struct file * filp) ...@@ -4077,9 +4080,9 @@ rs_open(struct tty_struct *tty, struct file * filp)
info->count++; info->count++;
tty->driver_data = info; tty->driver_data = info;
info->tty = tty; info->port.tty = tty;
info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; info->port.tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
if (!tmp_buf) { if (!tmp_buf) {
page = get_zeroed_page(GFP_KERNEL); page = get_zeroed_page(GFP_KERNEL);
...@@ -4267,14 +4270,14 @@ static int line_info(char *buf, struct e100_serial *info) ...@@ -4267,14 +4270,14 @@ static int line_info(char *buf, struct e100_serial *info)
(unsigned long)info->max_recv_cnt); (unsigned long)info->max_recv_cnt);
#if 1 #if 1
if (info->tty) { if (info->port.tty) {
if (info->tty->stopped) if (info->port.tty->stopped)
ret += sprintf(buf+ret, " stopped:%i", ret += sprintf(buf+ret, " stopped:%i",
(int)info->tty->stopped); (int)info->port.tty->stopped);
if (info->tty->hw_stopped) if (info->port.tty->hw_stopped)
ret += sprintf(buf+ret, " hw_stopped:%i", ret += sprintf(buf+ret, " hw_stopped:%i",
(int)info->tty->hw_stopped); (int)info->port.tty->hw_stopped);
} }
{ {
...@@ -4465,7 +4468,7 @@ rs_init(void) ...@@ -4465,7 +4468,7 @@ rs_init(void)
info->uses_dma_in = 0; info->uses_dma_in = 0;
info->uses_dma_out = 0; info->uses_dma_out = 0;
info->line = i; info->line = i;
info->tty = 0; info->port.tty = NULL;
info->type = PORT_ETRAX; info->type = PORT_ETRAX;
info->tr_running = 0; info->tr_running = 0;
info->forced_eop = 0; info->forced_eop = 0;
......
...@@ -197,7 +197,7 @@ static inline void dz_receive_chars(struct dz_mux *mux) ...@@ -197,7 +197,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) { while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) {
dport = &mux->dport[LINE(status)]; dport = &mux->dport[LINE(status)];
uport = &dport->port; uport = &dport->port;
tty = uport->info->tty; /* point to the proper dev */ tty = uport->info->port.tty; /* point to the proper dev */
ch = UCHAR(status); /* grab the char */ ch = UCHAR(status); /* grab the char */
flag = TTY_NORMAL; flag = TTY_NORMAL;
...@@ -249,7 +249,7 @@ static inline void dz_receive_chars(struct dz_mux *mux) ...@@ -249,7 +249,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
} }
for (i = 0; i < DZ_NB_PORT; i++) for (i = 0; i < DZ_NB_PORT; i++)
if (lines_rx[i]) if (lines_rx[i])
tty_flip_buffer_push(mux->dport[i].port.info->tty); tty_flip_buffer_push(mux->dport[i].port.info->port.tty);
} }
/* /*
......
...@@ -372,7 +372,7 @@ static irqreturn_t imx_rxint(int irq, void *dev_id) ...@@ -372,7 +372,7 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
{ {
struct imx_port *sport = dev_id; struct imx_port *sport = dev_id;
unsigned int rx,flg,ignored = 0; unsigned int rx,flg,ignored = 0;
struct tty_struct *tty = sport->port.info->tty; struct tty_struct *tty = sport->port.info->port.tty;
unsigned long flags, temp; unsigned long flags, temp;
spin_lock_irqsave(&sport->port.lock,flags); spin_lock_irqsave(&sport->port.lock,flags);
......
...@@ -1635,7 +1635,7 @@ static void transmit_chars(struct uart_port *the_port) ...@@ -1635,7 +1635,7 @@ static void transmit_chars(struct uart_port *the_port)
return; return;
info = the_port->info; info = the_port->info;
tty = info->tty; tty = info->port.tty;
if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) { if (uart_circ_empty(&info->xmit) || uart_tx_stopped(the_port)) {
/* Nothing to do or hw stopped */ /* Nothing to do or hw stopped */
...@@ -1738,14 +1738,14 @@ ioc4_change_speed(struct uart_port *the_port, ...@@ -1738,14 +1738,14 @@ ioc4_change_speed(struct uart_port *the_port,
the_port->ignore_status_mask = N_ALL_INPUT; the_port->ignore_status_mask = N_ALL_INPUT;
info->tty->low_latency = 1; info->port.tty->low_latency = 1;
if (I_IGNPAR(info->tty)) if (I_IGNPAR(info->port.tty))
the_port->ignore_status_mask &= ~(N_PARITY_ERROR the_port->ignore_status_mask &= ~(N_PARITY_ERROR
| N_FRAMING_ERROR); | N_FRAMING_ERROR);
if (I_IGNBRK(info->tty)) { if (I_IGNBRK(info->port.tty)) {
the_port->ignore_status_mask &= ~N_BREAK; the_port->ignore_status_mask &= ~N_BREAK;
if (I_IGNPAR(info->tty)) if (I_IGNPAR(info->port.tty))
the_port->ignore_status_mask &= ~N_OVERRUN_ERROR; the_port->ignore_status_mask &= ~N_OVERRUN_ERROR;
} }
if (!(cflag & CREAD)) { if (!(cflag & CREAD)) {
...@@ -1801,7 +1801,8 @@ static inline int ic4_startup_local(struct uart_port *the_port) ...@@ -1801,7 +1801,8 @@ static inline int ic4_startup_local(struct uart_port *the_port)
ioc4_set_proto(port, the_port->mapbase); ioc4_set_proto(port, the_port->mapbase);
/* set the speed of the serial port */ /* set the speed of the serial port */
ioc4_change_speed(the_port, info->tty->termios, (struct ktermios *)0); ioc4_change_speed(the_port, info->port.tty->termios,
(struct ktermios *)0);
return 0; return 0;
} }
...@@ -2346,11 +2347,11 @@ static void receive_chars(struct uart_port *the_port) ...@@ -2346,11 +2347,11 @@ static void receive_chars(struct uart_port *the_port)
/* Make sure all the pointers are "good" ones */ /* Make sure all the pointers are "good" ones */
if (!info) if (!info)
return; return;
if (!info->tty) if (!info->port.tty)
return; return;
spin_lock_irqsave(&the_port->lock, pflags); spin_lock_irqsave(&the_port->lock, pflags);
tty = info->tty; tty = info->port.tty;
request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS); request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS);
...@@ -2440,8 +2441,8 @@ static void ic4_shutdown(struct uart_port *the_port) ...@@ -2440,8 +2441,8 @@ static void ic4_shutdown(struct uart_port *the_port)
wake_up_interruptible(&info->delta_msr_wait); wake_up_interruptible(&info->delta_msr_wait);
if (info->tty) if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->tty->flags); set_bit(TTY_IO_ERROR, &info->port.tty->flags);
spin_lock_irqsave(&the_port->lock, port_flags); spin_lock_irqsave(&the_port->lock, port_flags);
set_notification(port, N_ALL, 0); set_notification(port, N_ALL, 0);
......
...@@ -257,8 +257,8 @@ static struct tty_struct *ip22zilog_receive_chars(struct uart_ip22zilog_port *up ...@@ -257,8 +257,8 @@ static struct tty_struct *ip22zilog_receive_chars(struct uart_ip22zilog_port *up
tty = NULL; tty = NULL;
if (up->port.info != NULL && if (up->port.info != NULL &&
up->port.info->tty != NULL) up->port.info->port.tty != NULL)
tty = up->port.info->tty; tty = up->port.info->port.tty;
for (;;) { for (;;) {
ch = readb(&channel->control); ch = readb(&channel->control);
......
...@@ -325,7 +325,7 @@ static void m32r_sio_enable_ms(struct uart_port *port) ...@@ -325,7 +325,7 @@ static void m32r_sio_enable_ms(struct uart_port *port)
static void receive_chars(struct uart_sio_port *up, int *status) static void receive_chars(struct uart_sio_port *up, int *status)
{ {
struct tty_struct *tty = up->port.info->tty; struct tty_struct *tty = up->port.info->port.tty;
unsigned char ch; unsigned char ch;
unsigned char flag; unsigned char flag;
int max_count = 256; int max_count = 256;
......
...@@ -312,7 +312,7 @@ static void mcf_rx_chars(struct mcf_uart *pp) ...@@ -312,7 +312,7 @@ static void mcf_rx_chars(struct mcf_uart *pp)
uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag); uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag);
} }
tty_flip_buffer_push(port->info->tty); tty_flip_buffer_push(port->info->port.tty);
} }
/****************************************************************************/ /****************************************************************************/
......
...@@ -327,7 +327,7 @@ static void mcfrs_start(struct tty_struct *tty) ...@@ -327,7 +327,7 @@ static void mcfrs_start(struct tty_struct *tty)
static inline void receive_chars(struct mcf_serial *info) static inline void receive_chars(struct mcf_serial *info)
{ {
volatile unsigned char *uartp; volatile unsigned char *uartp;
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
unsigned char status, ch, flag; unsigned char status, ch, flag;
if (!tty) if (!tty)
...@@ -382,7 +382,7 @@ static inline void transmit_chars(struct mcf_serial *info) ...@@ -382,7 +382,7 @@ static inline void transmit_chars(struct mcf_serial *info)
info->stats.tx++; info->stats.tx++;
} }
if ((info->xmit_cnt <= 0) || info->tty->stopped) { if ((info->xmit_cnt <= 0) || info->port.tty->stopped) {
info->imr &= ~MCFUART_UIR_TXREADY; info->imr &= ~MCFUART_UIR_TXREADY;
uartp[MCFUART_UIMR] = info->imr; uartp[MCFUART_UIMR] = info->imr;
return; return;
...@@ -428,7 +428,7 @@ irqreturn_t mcfrs_interrupt(int irq, void *dev_id) ...@@ -428,7 +428,7 @@ irqreturn_t mcfrs_interrupt(int irq, void *dev_id)
static void mcfrs_offintr(struct work_struct *work) static void mcfrs_offintr(struct work_struct *work)
{ {
struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue); struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue);
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
if (tty) if (tty)
tty_wakeup(tty); tty_wakeup(tty);
...@@ -498,7 +498,7 @@ static void mcfrs_timer(void) ...@@ -498,7 +498,7 @@ static void mcfrs_timer(void)
static void do_serial_hangup(struct work_struct *work) static void do_serial_hangup(struct work_struct *work)
{ {
struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue_hangup); struct mcf_serial *info = container_of(work, struct mcf_serial, tqueue_hangup);
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->port.tty;
if (tty) if (tty)
tty_hangup(tty); tty_hangup(tty);
...@@ -532,8 +532,8 @@ static int startup(struct mcf_serial * info) ...@@ -532,8 +532,8 @@ static int startup(struct mcf_serial * info)
uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */ uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */
mcfrs_setsignals(info, 1, 1); mcfrs_setsignals(info, 1, 1);
if (info->tty) if (info->port.tty)
clear_bit(TTY_IO_ERROR, &info->tty->flags); clear_bit(TTY_IO_ERROR, &info->port.tty->flags);
info->xmit_cnt = info->xmit_head = info->xmit_tail = 0; info->xmit_cnt = info->xmit_head = info->xmit_tail = 0;
/* /*
...@@ -578,7 +578,7 @@ static void shutdown(struct mcf_serial * info) ...@@ -578,7 +578,7 @@ static void shutdown(struct mcf_serial * info)
uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETRX; /* reset RX */ uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETRX; /* reset RX */
uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */ uartp[MCFUART_UCR] = MCFUART_UCR_CMDRESETTX; /* reset TX */
if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) if (!info->port.tty || (info->port.tty->termios->c_cflag & HUPCL))
mcfrs_setsignals(info, 0, 0); mcfrs_setsignals(info, 0, 0);
if (info->xmit_buf) { if (info->xmit_buf) {
...@@ -586,8 +586,8 @@ static void shutdown(struct mcf_serial * info) ...@@ -586,8 +586,8 @@ static void shutdown(struct mcf_serial * info)
info->xmit_buf = 0; info->xmit_buf = 0;
} }
if (info->tty) if (info->port.tty)
set_bit(TTY_IO_ERROR, &info->tty->flags); set_bit(TTY_IO_ERROR, &info->port.tty->flags);
info->flags &= ~ASYNC_INITIALIZED; info->flags &= ~ASYNC_INITIALIZED;
local_irq_restore(flags); local_irq_restore(flags);
...@@ -609,9 +609,9 @@ static void mcfrs_change_speed(struct mcf_serial *info) ...@@ -609,9 +609,9 @@ static void mcfrs_change_speed(struct mcf_serial *info)
unsigned int fraction; unsigned int fraction;
#endif #endif
if (!info->tty || !info->tty->termios) if (!info->port.tty || !info->port.tty->termios)
return; return;
cflag = info->tty->termios->c_cflag; cflag = info->port.tty->termios->c_cflag;
if (info->addr == 0) if (info->addr == 0)
return; return;
...@@ -623,7 +623,7 @@ static void mcfrs_change_speed(struct mcf_serial *info) ...@@ -623,7 +623,7 @@ static void mcfrs_change_speed(struct mcf_serial *info)
if (i & CBAUDEX) { if (i & CBAUDEX) {
i &= ~CBAUDEX; i &= ~CBAUDEX;
if (i < 1 || i > 4) if (i < 1 || i > 4)
info->tty->termios->c_cflag &= ~CBAUDEX; info->port.tty->termios->c_cflag &= ~CBAUDEX;
else else
i += 15; i += 15;
} }
...@@ -1216,7 +1216,7 @@ static void mcfrs_close(struct tty_struct *tty, struct file * filp) ...@@ -1216,7 +1216,7 @@ static void mcfrs_close(struct tty_struct *tty, struct file * filp)
tty->closing = 0; tty->closing = 0;
info->event = 0; info->event = 0;
info->tty = 0; info->port.tty = NULL;
#if 0 #if 0
if (tty->ldisc.num != ldiscs[N_TTY].num) { if (tty->ldisc.num != ldiscs[N_TTY].num) {
if (tty->ldisc.close) if (tty->ldisc.close)
...@@ -1325,7 +1325,7 @@ void mcfrs_hangup(struct tty_struct *tty) ...@@ -1325,7 +1325,7 @@ void mcfrs_hangup(struct tty_struct *tty)
info->event = 0; info->event = 0;
info->count = 0; info->count = 0;
info->flags &= ~ASYNC_NORMAL_ACTIVE; info->flags &= ~ASYNC_NORMAL_ACTIVE;
info->tty = 0; info->port.tty = NULL;
wake_up_interruptible(&info->open_wait); wake_up_interruptible(&info->open_wait);
} }
...@@ -1452,7 +1452,7 @@ int mcfrs_open(struct tty_struct *tty, struct file * filp) ...@@ -1452,7 +1452,7 @@ int mcfrs_open(struct tty_struct *tty, struct file * filp)
#endif #endif
info->count++; info->count++;
tty->driver_data = info; tty->driver_data = info;
info->tty = tty; info->port.tty = tty;
/* /*
* Start up serial port * Start up serial port
...@@ -1767,7 +1767,7 @@ mcfrs_init(void) ...@@ -1767,7 +1767,7 @@ mcfrs_init(void)
for (i = 0, info = mcfrs_table; (i < NR_PORTS); i++, info++) { for (i = 0, info = mcfrs_table; (i < NR_PORTS); i++, info++) {
info->magic = SERIAL_MAGIC; info->magic = SERIAL_MAGIC;
info->line = i; info->line = i;
info->tty = 0; info->port.tty = NULL;
info->custom_divisor = 16; info->custom_divisor = 16;
info->close_delay = 50; info->close_delay = 50;
info->closing_wait = 3000; info->closing_wait = 3000;
......
...@@ -732,7 +732,7 @@ static struct uart_ops mpc52xx_uart_ops = { ...@@ -732,7 +732,7 @@ static struct uart_ops mpc52xx_uart_ops = {
static inline int static inline int
mpc52xx_uart_int_rx_chars(struct uart_port *port) mpc52xx_uart_int_rx_chars(struct uart_port *port)
{ {
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
unsigned char ch, flag; unsigned char ch, flag;
unsigned short status; unsigned short status;
......
...@@ -932,7 +932,7 @@ static int mpsc_make_ready(struct mpsc_port_info *pi) ...@@ -932,7 +932,7 @@ static int mpsc_make_ready(struct mpsc_port_info *pi)
static int mpsc_rx_intr(struct mpsc_port_info *pi) static int mpsc_rx_intr(struct mpsc_port_info *pi)
{ {
struct mpsc_rx_desc *rxre; struct mpsc_rx_desc *rxre;
struct tty_struct *tty = pi->port.info->tty; struct tty_struct *tty = pi->port.info->port.tty;
u32 cmdstat, bytes_in, i; u32 cmdstat, bytes_in, i;
int rc = 0; int rc = 0;
u8 *bp; u8 *bp;
......
...@@ -243,7 +243,7 @@ static void mux_write(struct uart_port *port) ...@@ -243,7 +243,7 @@ static void mux_write(struct uart_port *port)
static void mux_read(struct uart_port *port) static void mux_read(struct uart_port *port)
{ {
int data; int data;
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
__u32 start_count = port->icount.rx; __u32 start_count = port->icount.rx;
while(1) { while(1) {
......
...@@ -203,7 +203,7 @@ static void netx_txint(struct uart_port *port) ...@@ -203,7 +203,7 @@ static void netx_txint(struct uart_port *port)
static void netx_rxint(struct uart_port *port) static void netx_rxint(struct uart_port *port)
{ {
unsigned char rx, flg, status; unsigned char rx, flg, status;
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
while (!(readl(port->membase + UART_FR) & FR_RXFE)) { while (!(readl(port->membase + UART_FR) & FR_RXFE)) {
rx = readl(port->membase + UART_DR); rx = readl(port->membase + UART_DR);
......
...@@ -181,7 +181,7 @@ static void pnx8xxx_enable_ms(struct uart_port *port) ...@@ -181,7 +181,7 @@ static void pnx8xxx_enable_ms(struct uart_port *port)
static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport)
{ {
struct tty_struct *tty = sport->port.info->tty; struct tty_struct *tty = sport->port.info->port.tty;
unsigned int status, ch, flg; unsigned int status, ch, flg;
status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) | status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) |
......
...@@ -101,7 +101,7 @@ static void serial_pxa_stop_rx(struct uart_port *port) ...@@ -101,7 +101,7 @@ static void serial_pxa_stop_rx(struct uart_port *port)
static inline void receive_chars(struct uart_pxa_port *up, int *status) static inline void receive_chars(struct uart_pxa_port *up, int *status)
{ {
struct tty_struct *tty = up->port.info->tty; struct tty_struct *tty = up->port.info->port.tty;
unsigned int ch, flag; unsigned int ch, flag;
int max_count = 256; int max_count = 256;
......
...@@ -189,7 +189,7 @@ static void sa1100_enable_ms(struct uart_port *port) ...@@ -189,7 +189,7 @@ static void sa1100_enable_ms(struct uart_port *port)
static void static void
sa1100_rx_chars(struct sa1100_port *sport) sa1100_rx_chars(struct sa1100_port *sport)
{ {
struct tty_struct *tty = sport->port.info->tty; struct tty_struct *tty = sport->port.info->port.tty;
unsigned int status, ch, flg; unsigned int status, ch, flg;
status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) | status = UTSR1_TO_SM(UART_GET_UTSR1(sport)) |
......
...@@ -384,7 +384,7 @@ static void sbd_receive_chars(struct sbd_port *sport) ...@@ -384,7 +384,7 @@ static void sbd_receive_chars(struct sbd_port *sport)
uart_insert_char(uport, status, M_DUART_OVRUN_ERR, ch, flag); uart_insert_char(uport, status, M_DUART_OVRUN_ERR, ch, flag);
} }
tty_flip_buffer_push(uport->info->tty); tty_flip_buffer_push(uport->info->port.tty);
} }
static void sbd_transmit_chars(struct sbd_port *sport) static void sbd_transmit_chars(struct sbd_port *sport)
......
...@@ -141,7 +141,7 @@ static struct tty_struct *receive_chars(struct uart_port *port) ...@@ -141,7 +141,7 @@ static struct tty_struct *receive_chars(struct uart_port *port)
u8 status; u8 status;
if (port->info != NULL) /* Unopened serial console */ if (port->info != NULL) /* Unopened serial console */
tty = port->info->tty; tty = port->info->port.tty;
while (limit-- > 0) { while (limit-- > 0) {
status = READ_SC_PORT(port, SR); status = READ_SC_PORT(port, SR);
......
...@@ -108,7 +108,7 @@ static void ks8695uart_disable_ms(struct uart_port *port) ...@@ -108,7 +108,7 @@ static void ks8695uart_disable_ms(struct uart_port *port)
static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id) static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id)
{ {
struct uart_port *port = dev_id; struct uart_port *port = dev_id;
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
unsigned int status, ch, lsr, flg, max_count = 256; unsigned int status, ch, lsr, flg, max_count = 256;
status = UART_GET_LSR(port); /* clears pending LSR interrupts */ status = UART_GET_LSR(port); /* clears pending LSR interrupts */
......
...@@ -137,7 +137,7 @@ static void lh7a40xuart_enable_ms (struct uart_port* port) ...@@ -137,7 +137,7 @@ static void lh7a40xuart_enable_ms (struct uart_port* port)
static void lh7a40xuart_rx_chars (struct uart_port* port) static void lh7a40xuart_rx_chars (struct uart_port* port)
{ {
struct tty_struct* tty = port->info->tty; struct tty_struct* tty = port->info->port.tty;
int cbRxMax = 256; /* (Gross) limit on receive */ int cbRxMax = 256; /* (Gross) limit on receive */
unsigned int data; /* Received data and status */ unsigned int data; /* Received data and status */
unsigned int flag; unsigned int flag;
......
...@@ -521,7 +521,7 @@ static void sci_transmit_chars(struct uart_port *port) ...@@ -521,7 +521,7 @@ static void sci_transmit_chars(struct uart_port *port)
static inline void sci_receive_chars(struct uart_port *port) static inline void sci_receive_chars(struct uart_port *port)
{ {
struct sci_port *sci_port = (struct sci_port *)port; struct sci_port *sci_port = (struct sci_port *)port;
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
int i, count, copied = 0; int i, count, copied = 0;
unsigned short status; unsigned short status;
unsigned char flag; unsigned char flag;
...@@ -642,7 +642,7 @@ static inline int sci_handle_errors(struct uart_port *port) ...@@ -642,7 +642,7 @@ static inline int sci_handle_errors(struct uart_port *port)
{ {
int copied = 0; int copied = 0;
unsigned short status = sci_in(port, SCxSR); unsigned short status = sci_in(port, SCxSR);
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
if (status & SCxSR_ORER(port)) { if (status & SCxSR_ORER(port)) {
/* overrun error */ /* overrun error */
...@@ -692,7 +692,7 @@ static inline int sci_handle_breaks(struct uart_port *port) ...@@ -692,7 +692,7 @@ static inline int sci_handle_breaks(struct uart_port *port)
{ {
int copied = 0; int copied = 0;
unsigned short status = sci_in(port, SCxSR); unsigned short status = sci_in(port, SCxSR);
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
struct sci_port *s = &sci_ports[port->line]; struct sci_port *s = &sci_ports[port->line];
if (uart_handle_break(port)) if (uart_handle_break(port))
...@@ -762,7 +762,7 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr) ...@@ -762,7 +762,7 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr)
} else { } else {
#if defined(SCIF_ORER) #if defined(SCIF_ORER)
if((sci_in(port, SCLSR) & SCIF_ORER) != 0) { if((sci_in(port, SCLSR) & SCIF_ORER) != 0) {
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
sci_out(port, SCLSR, 0); sci_out(port, SCLSR, 0);
tty_insert_flip_char(tty, 0, TTY_OVERRUN); tty_insert_flip_char(tty, 0, TTY_OVERRUN);
......
...@@ -75,7 +75,7 @@ static struct uart_port ulite_ports[ULITE_NR_UARTS]; ...@@ -75,7 +75,7 @@ static struct uart_port ulite_ports[ULITE_NR_UARTS];
static int ulite_receive(struct uart_port *port, int stat) static int ulite_receive(struct uart_port *port, int stat)
{ {
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
unsigned char ch = 0; unsigned char ch = 0;
char flag = TTY_NORMAL; char flag = TTY_NORMAL;
...@@ -162,7 +162,7 @@ static irqreturn_t ulite_isr(int irq, void *dev_id) ...@@ -162,7 +162,7 @@ static irqreturn_t ulite_isr(int irq, void *dev_id)
busy |= ulite_transmit(port, stat); busy |= ulite_transmit(port, stat);
} while (busy); } while (busy);
tty_flip_buffer_push(port->info->tty); tty_flip_buffer_push(port->info->port.tty);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -466,7 +466,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port) ...@@ -466,7 +466,7 @@ static void qe_uart_int_rx(struct uart_qe_port *qe_port)
int i; int i;
unsigned char ch, *cp; unsigned char ch, *cp;
struct uart_port *port = &qe_port->port; struct uart_port *port = &qe_port->port;
struct tty_struct *tty = port->info->tty; struct tty_struct *tty = port->info->port.tty;
struct qe_bd *bdp; struct qe_bd *bdp;
u16 status; u16 status;
unsigned int flg; unsigned int flg;
......
...@@ -300,8 +300,8 @@ static irqreturn_t v850e_uart_rx_irq(int irq, void *data) ...@@ -300,8 +300,8 @@ static irqreturn_t v850e_uart_rx_irq(int irq, void *data)
port->icount.rx++; port->icount.rx++;
tty_insert_flip_char (port->info->tty, ch, ch_stat); tty_insert_flip_char (port->info->port.tty, ch, ch_stat);
tty_schedule_flip (port->info->tty); tty_schedule_flip (port->info->port.tty);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
...@@ -318,7 +318,7 @@ static inline void receive_chars(struct uart_port *port, uint8_t *status) ...@@ -318,7 +318,7 @@ static inline void receive_chars(struct uart_port *port, uint8_t *status)
char flag; char flag;
int max_count = RX_MAX_COUNT; int max_count = RX_MAX_COUNT;
tty = port->info->tty; tty = port->info->port.tty;
lsr = *status; lsr = *status;
do { do {
......
...@@ -602,7 +602,7 @@ static void zs_receive_chars(struct zs_port *zport) ...@@ -602,7 +602,7 @@ static void zs_receive_chars(struct zs_port *zport)
uart_insert_char(uport, status, Rx_OVR, ch, flag); uart_insert_char(uport, status, Rx_OVR, ch, flag);
} }
tty_flip_buffer_push(uport->info->tty); tty_flip_buffer_push(uport->info->port.tty);
} }
static void zs_raw_transmit_chars(struct zs_port *zport) static void zs_raw_transmit_chars(struct zs_port *zport)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment