nfsd: fix Documentation typo
[safe/jmp/linux-2.6] / drivers / serial / mcf.c
index e76fc72..b443824 100644 (file)
@@ -212,10 +212,18 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios,
 {
        unsigned long flags;
        unsigned int baud, baudclk;
+#if defined(CONFIG_M5272)
+       unsigned int baudfr;
+#endif
        unsigned char mr1, mr2;
 
        baud = uart_get_baud_rate(port, termios, old, 0, 230400);
+#if defined(CONFIG_M5272)
+       baudclk = (MCF_BUSCLK / baud) / 32;
+       baudfr = (((MCF_BUSCLK / baud) + 1) / 2) % 16;
+#else
        baudclk = ((MCF_BUSCLK / baud) + 16) / 32;
+#endif
 
        mr1 = MCFUART_MR1_RXIRQRDY | MCFUART_MR1_RXERRCHAR;
        mr2 = 0;
@@ -262,6 +270,9 @@ static void mcf_set_termios(struct uart_port *port, struct ktermios *termios,
        writeb(mr2, port->membase + MCFUART_UMR);
        writeb((baudclk & 0xff00) >> 8, port->membase + MCFUART_UBG1);
        writeb((baudclk & 0xff), port->membase + MCFUART_UBG2);
+#if defined(CONFIG_M5272)
+       writeb((baudfr & 0x0f), port->membase + MCFUART_UFPD);
+#endif
        writeb(MCFUART_UCSR_RXCLKTIMER | MCFUART_UCSR_TXCLKTIMER,
                port->membase + MCFUART_UCSR);
        writeb(MCFUART_UCR_RXENABLE | MCFUART_UCR_TXENABLE,
@@ -312,7 +323,7 @@ static void mcf_rx_chars(struct mcf_uart *pp)
                uart_insert_char(port, status, MCFUART_USR_RXOVERRUN, ch, flag);
        }
 
-       tty_flip_buffer_push(port->info->tty);
+       tty_flip_buffer_push(port->state->port.tty);
 }
 
 /****************************************************************************/
@@ -320,7 +331,7 @@ static void mcf_rx_chars(struct mcf_uart *pp)
 static void mcf_tx_chars(struct mcf_uart *pp)
 {
        struct uart_port *port = &pp->port;
-       struct circ_buf *xmit = &port->info->xmit;
+       struct circ_buf *xmit = &port->state->xmit;
 
        if (port->x_char) {
                /* Send special char - probably flow control */
@@ -502,7 +513,7 @@ static int __init mcf_console_setup(struct console *co, char *options)
        int parity = 'n';
        int flow = 'n';
 
-       if ((co->index >= 0) && (co->index <= MCF_MAXPORTS))
+       if ((co->index < 0) || (co->index >= MCF_MAXPORTS))
                co->index = 0;
        port = &mcf_ports[co->index].port;
        if (port->membase == 0)
@@ -649,5 +660,6 @@ module_exit(mcf_exit);
 MODULE_AUTHOR("Greg Ungerer <gerg@snapgear.com>");
 MODULE_DESCRIPTION("Freescale ColdFire UART driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:mcfuart");
 
 /****************************************************************************/