Skip to content

Commit

Permalink
serial: kill off uart_info
Browse files Browse the repository at this point in the history
We moved this into uart_state, now move the fields out of the separate
structure and kill it off.

Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Alan Cox authored and Live-CD User committed Sep 19, 2009
1 parent 11d85d7 commit ebd2c8f
Show file tree
Hide file tree
Showing 50 changed files with 422 additions and 432 deletions.
6 changes: 3 additions & 3 deletions arch/mn10300/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void foo(void)
OFFSET(__iobase, mn10300_serial_port, _iobase);

DEFINE(__UART_XMIT_SIZE, UART_XMIT_SIZE);
OFFSET(__xmit_buffer, uart_info, xmit.buf);
OFFSET(__xmit_head, uart_info, xmit.head);
OFFSET(__xmit_tail, uart_info, xmit.tail);
OFFSET(__xmit_buffer, uart_state, xmit.buf);
OFFSET(__xmit_head, uart_state, xmit.head);
OFFSET(__xmit_tail, uart_state, xmit.tail);
}
8 changes: 4 additions & 4 deletions drivers/serial/21285.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static void serial21285_enable_ms(struct uart_port *port)
static irqreturn_t serial21285_rx_chars(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned int status, ch, flag, rxs, max_count = 256;

status = *CSR_UARTFLG;
Expand Down Expand Up @@ -124,7 +124,7 @@ static irqreturn_t serial21285_rx_chars(int irq, void *dev_id)
static irqreturn_t serial21285_tx_chars(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
int count = 256;

if (port->x_char) {
Expand Down Expand Up @@ -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);
quot = uart_get_divisor(port, baud);

if (port->info && port->info->port.tty) {
struct tty_struct *tty = port->info->port.tty;
if (port->state && port->state->port.tty) {
struct tty_struct *tty = port->state->port.tty;
unsigned int b = port->uartclk / (16 * quot);
tty_encode_baud_rate(tty, b, b);
}
Expand Down
10 changes: 5 additions & 5 deletions drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,7 @@ static void serial8250_enable_ms(struct uart_port *port)
static void
receive_chars(struct uart_8250_port *up, unsigned int *status)
{
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned char ch, lsr = *status;
int max_count = 256;
char flag;
Expand Down Expand Up @@ -1457,7 +1457,7 @@ receive_chars(struct uart_8250_port *up, unsigned int *status)

static void transmit_chars(struct uart_8250_port *up)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;
int count;

if (up->port.x_char) {
Expand Down Expand Up @@ -1500,7 +1500,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up)
status |= up->msr_saved_flags;
up->msr_saved_flags = 0;
if (status & UART_MSR_ANY_DELTA && up->ier & UART_IER_MSI &&
up->port.info != NULL) {
up->port.state != NULL) {
if (status & UART_MSR_TERI)
up->port.icount.rng++;
if (status & UART_MSR_DDSR)
Expand All @@ -1510,7 +1510,7 @@ static unsigned int check_modem_status(struct uart_8250_port *up)
if (status & UART_MSR_DCTS)
uart_handle_cts_change(&up->port, status & UART_MSR_CTS);

wake_up_interruptible(&up->port.info->delta_msr_wait);
wake_up_interruptible(&up->port.state->delta_msr_wait);
}

return status;
Expand Down Expand Up @@ -1764,7 +1764,7 @@ static void serial8250_backup_timeout(unsigned long data)
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
spin_unlock_irqrestore(&up->port.lock, flags);
if ((iir & UART_IIR_NO_INT) && (up->ier & UART_IER_THRI) &&
(!uart_circ_empty(&up->port.info->xmit) || up->port.x_char) &&
(!uart_circ_empty(&up->port.state->xmit) || up->port.x_char) &&
(lsr & UART_LSR_THRE)) {
iir &= ~(UART_IIR_ID | UART_IIR_NO_INT);
iir |= UART_IIR_THRI;
Expand Down
6 changes: 3 additions & 3 deletions drivers/serial/amba-pl010.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static void pl010_enable_ms(struct uart_port *port)

static void pl010_rx_chars(struct uart_amba_port *uap)
{
struct tty_struct *tty = uap->port.info->port.tty;
struct tty_struct *tty = uap->port.state->port.tty;
unsigned int status, ch, flag, rsr, max_count = 256;

status = readb(uap->port.membase + UART01x_FR);
Expand Down Expand Up @@ -172,7 +172,7 @@ static void pl010_rx_chars(struct uart_amba_port *uap)

static void pl010_tx_chars(struct uart_amba_port *uap)
{
struct circ_buf *xmit = &uap->port.info->xmit;
struct circ_buf *xmit = &uap->port.state->xmit;
int count;

if (uap->port.x_char) {
Expand Down Expand Up @@ -225,7 +225,7 @@ static void pl010_modem_status(struct uart_amba_port *uap)
if (delta & UART01x_FR_CTS)
uart_handle_cts_change(&uap->port, status & UART01x_FR_CTS);

wake_up_interruptible(&uap->port.info->delta_msr_wait);
wake_up_interruptible(&uap->port.state->delta_msr_wait);
}

static irqreturn_t pl010_int(int irq, void *dev_id)
Expand Down
6 changes: 3 additions & 3 deletions drivers/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static void pl011_enable_ms(struct uart_port *port)

static void pl011_rx_chars(struct uart_amba_port *uap)
{
struct tty_struct *tty = uap->port.info->port.tty;
struct tty_struct *tty = uap->port.state->port.tty;
unsigned int status, ch, flag, max_count = 256;

status = readw(uap->port.membase + UART01x_FR);
Expand Down Expand Up @@ -175,7 +175,7 @@ static void pl011_rx_chars(struct uart_amba_port *uap)

static void pl011_tx_chars(struct uart_amba_port *uap)
{
struct circ_buf *xmit = &uap->port.info->xmit;
struct circ_buf *xmit = &uap->port.state->xmit;
int count;

if (uap->port.x_char) {
Expand Down Expand Up @@ -226,7 +226,7 @@ static void pl011_modem_status(struct uart_amba_port *uap)
if (delta & UART01x_FR_CTS)
uart_handle_cts_change(&uap->port, status & UART01x_FR_CTS);

wake_up_interruptible(&uap->port.info->delta_msr_wait);
wake_up_interruptible(&uap->port.state->delta_msr_wait);
}

static irqreturn_t pl011_int(int irq, void *dev_id)
Expand Down
14 changes: 7 additions & 7 deletions drivers/serial/atmel_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static void atmel_rx_chars(struct uart_port *port)
*/
static void atmel_tx_chars(struct uart_port *port)
{
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;

if (port->x_char && UART_GET_CSR(port) & ATMEL_US_TXRDY) {
UART_PUT_CHAR(port, port->x_char);
Expand Down Expand Up @@ -560,7 +560,7 @@ static irqreturn_t atmel_interrupt(int irq, void *dev_id)
static void atmel_tx_dma(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
int count;

Expand Down Expand Up @@ -663,14 +663,14 @@ static void atmel_rx_from_ring(struct uart_port *port)
* uart_start(), which takes the lock.
*/
spin_unlock(&port->lock);
tty_flip_buffer_push(port->info->port.tty);
tty_flip_buffer_push(port->state->port.tty);
spin_lock(&port->lock);
}

static void atmel_rx_from_dma(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
struct atmel_dma_buffer *pdc;
int rx_idx = atmel_port->pdc_rx_idx;
unsigned int head;
Expand Down Expand Up @@ -776,7 +776,7 @@ static void atmel_tasklet_func(unsigned long data)
if (status_change & ATMEL_US_CTS)
uart_handle_cts_change(port, !(status & ATMEL_US_CTS));

wake_up_interruptible(&port->info->delta_msr_wait);
wake_up_interruptible(&port->state->delta_msr_wait);

atmel_port->irq_status_prev = status;
}
Expand All @@ -795,7 +795,7 @@ static void atmel_tasklet_func(unsigned long data)
static int atmel_startup(struct uart_port *port)
{
struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
int retval;

/*
Expand Down Expand Up @@ -854,7 +854,7 @@ static int atmel_startup(struct uart_port *port)
}
if (atmel_use_dma_tx(port)) {
struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;

pdc->buf = xmit->buf;
pdc->dma_addr = dma_map_single(port->dev,
Expand Down
20 changes: 10 additions & 10 deletions drivers/serial/bfin_5xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static void bfin_serial_stop_tx(struct uart_port *port)
{
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
#ifdef CONFIG_SERIAL_BFIN_DMA
struct circ_buf *xmit = &uart->port.info->xmit;
struct circ_buf *xmit = &uart->port.state->xmit;
#endif

while (!(UART_GET_LSR(uart) & TEMT))
Expand All @@ -171,7 +171,7 @@ static void bfin_serial_stop_tx(struct uart_port *port)
static void bfin_serial_start_tx(struct uart_port *port)
{
struct bfin_serial_port *uart = (struct bfin_serial_port *)port;
struct tty_struct *tty = uart->port.info->port.tty;
struct tty_struct *tty = uart->port.state->port.tty;

#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
if (uart->scts && !(bfin_serial_get_mctrl(&uart->port) & TIOCM_CTS)) {
Expand Down Expand Up @@ -243,10 +243,10 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)
return;
}

if (!uart->port.info || !uart->port.info->port.tty)
if (!uart->port.state || !uart->port.state->port.tty)
return;
#endif
tty = uart->port.info->port.tty;
tty = uart->port.state->port.tty;

if (ANOMALY_05000363) {
/* The BF533 (and BF561) family of processors have a nice anomaly
Expand Down Expand Up @@ -331,7 +331,7 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart)

static void bfin_serial_tx_chars(struct bfin_serial_port *uart)
{
struct circ_buf *xmit = &uart->port.info->xmit;
struct circ_buf *xmit = &uart->port.state->xmit;

if (uart_circ_empty(xmit) || uart_tx_stopped(&uart->port)) {
#ifdef CONFIG_BF54x
Expand Down Expand Up @@ -398,7 +398,7 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
#ifdef CONFIG_SERIAL_BFIN_DMA
static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart)
{
struct circ_buf *xmit = &uart->port.info->xmit;
struct circ_buf *xmit = &uart->port.state->xmit;

uart->tx_done = 0;

Expand Down Expand Up @@ -436,7 +436,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)
{
struct tty_struct *tty = uart->port.info->port.tty;
struct tty_struct *tty = uart->port.state->port.tty;
int i, flg, status;

status = UART_GET_LSR(uart);
Expand Down Expand Up @@ -529,7 +529,7 @@ void bfin_serial_rx_dma_timeout(struct bfin_serial_port *uart)
static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id)
{
struct bfin_serial_port *uart = dev_id;
struct circ_buf *xmit = &uart->port.info->xmit;
struct circ_buf *xmit = &uart->port.state->xmit;

#ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
if (uart->scts && !(bfin_serial_get_mctrl(&uart->port)&TIOCM_CTS)) {
Expand Down Expand Up @@ -965,10 +965,10 @@ static void bfin_serial_set_ldisc(struct uart_port *port)
int line = port->line;
unsigned short val;

if (line >= port->info->port.tty->driver->num)
if (line >= port->state->port.tty->driver->num)
return;

switch (port->info->port.tty->termios->c_line) {
switch (port->state->port.tty->termios->c_line) {
case N_IRDA:
val = UART_GET_GCTL(&bfin_serial_ports[line]);
val |= (IREN | RPOLC);
Expand Down
6 changes: 3 additions & 3 deletions drivers/serial/bfin_sport_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,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)
{
struct sport_uart_port *up = dev_id;
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned int ch;

do {
Expand All @@ -205,7 +205,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)
{
struct sport_uart_port *up = dev_id;
struct tty_struct *tty = up->port.info->port.tty;
struct tty_struct *tty = up->port.state->port.tty;
unsigned int stat = SPORT_GET_STAT(up);

/* Overflow in RX FIFO */
Expand Down Expand Up @@ -290,7 +290,7 @@ static int sport_startup(struct uart_port *port)

static void sport_uart_tx_chars(struct sport_uart_port *up)
{
struct circ_buf *xmit = &up->port.info->xmit;
struct circ_buf *xmit = &up->port.state->xmit;

if (SPORT_GET_STAT(up) & TXF)
return;
Expand Down
4 changes: 2 additions & 2 deletions drivers/serial/clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void clps711xuart_enable_ms(struct uart_port *port)
static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
unsigned int status, ch, flg;

status = clps_readl(SYSFLG(port));
Expand Down Expand Up @@ -147,7 +147,7 @@ static irqreturn_t clps711xuart_int_rx(int irq, void *dev_id)
static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
{
struct uart_port *port = dev_id;
struct circ_buf *xmit = &port->info->xmit;
struct circ_buf *xmit = &port->state->xmit;
int count;

if (port->x_char) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/cpm_uart/cpm_uart_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static void cpm_uart_int_rx(struct uart_port *port)
int i;
unsigned char ch;
u8 *cp;
struct tty_struct *tty = port->info->port.tty;
struct tty_struct *tty = port->state->port.tty;
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
cbd_t __iomem *bdp;
u16 status;
Expand Down
6 changes: 3 additions & 3 deletions drivers/serial/dz.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) {
dport = &mux->dport[LINE(status)];
uport = &dport->port;
tty = uport->info->port.tty; /* point to the proper dev */
tty = uport->state->port.tty; /* point to the proper dev */

ch = UCHAR(status); /* grab the char */
flag = TTY_NORMAL;
Expand Down Expand Up @@ -249,7 +249,7 @@ static inline void dz_receive_chars(struct dz_mux *mux)
}
for (i = 0; i < DZ_NB_PORT; i++)
if (lines_rx[i])
tty_flip_buffer_push(mux->dport[i].port.info->port.tty);
tty_flip_buffer_push(mux->dport[i].port.state->port.tty);
}

/*
Expand All @@ -268,7 +268,7 @@ static inline void dz_transmit_chars(struct dz_mux *mux)

status = dz_in(dport, DZ_CSR);
dport = &mux->dport[LINE(status)];
xmit = &dport->port.info->xmit;
xmit = &dport->port.state->xmit;

if (dport->port.x_char) { /* XON/XOFF chars */
dz_out(dport, DZ_TDR, dport->port.x_char);
Expand Down
Loading

0 comments on commit ebd2c8f

Please sign in to comment.