Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart
[pandora-kernel.git] / drivers / serial / amba-pl010.c
index 7311d84..f69bd09 100644 (file)
@@ -111,12 +111,7 @@ static void pl010_enable_ms(struct uart_port *port)
        writel(cr, port->membase + UART010_CR);
 }
 
-static void
-#ifdef SUPPORT_SYSRQ
-pl010_rx_chars(struct uart_port *port, struct pt_regs *regs)
-#else
-pl010_rx_chars(struct uart_port *port)
-#endif
+static void pl010_rx_chars(struct uart_port *port)
 {
        struct tty_struct *tty = port->info->tty;
        unsigned int status, ch, flag, rsr, max_count = 256;
@@ -134,6 +129,8 @@ pl010_rx_chars(struct uart_port *port)
                 */
                rsr = readb(port->membase + UART01x_RSR) | UART_DUMMY_RSR_RX;
                if (unlikely(rsr & UART01x_RSR_ANY)) {
+                       writel(0, port->membase + UART01x_ECR);
+
                        if (rsr & UART01x_RSR_BE) {
                                rsr &= ~(UART01x_RSR_FE | UART01x_RSR_PE);
                                port->icount.brk++;
@@ -156,7 +153,7 @@ pl010_rx_chars(struct uart_port *port)
                                flag = TTY_FRAME;
                }
 
-               if (uart_handle_sysrq_char(port, ch, regs))
+               if (uart_handle_sysrq_char(port, ch))
                        goto ignore_char;
 
                uart_insert_char(port, rsr, UART01x_RSR_OE, ch, flag);
@@ -227,7 +224,7 @@ static void pl010_modem_status(struct uart_port *port)
        wake_up_interruptible(&uap->port.info->delta_msr_wait);
 }
 
-static irqreturn_t pl010_int(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t pl010_int(int irq, void *dev_id)
 {
        struct uart_port *port = dev_id;
        unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT;
@@ -239,11 +236,7 @@ static irqreturn_t pl010_int(int irq, void *dev_id, struct pt_regs *regs)
        if (status) {
                do {
                        if (status & (UART010_IIR_RTIS | UART010_IIR_RIS))
-#ifdef SUPPORT_SYSRQ
-                               pl010_rx_chars(port, regs);
-#else
                                pl010_rx_chars(port);
-#endif
                        if (status & UART010_IIR_MIS)
                                pl010_modem_status(port);
                        if (status & UART010_IIR_TIS)
@@ -352,8 +345,8 @@ static void pl010_shutdown(struct uart_port *port)
 }
 
 static void
-pl010_set_termios(struct uart_port *port, struct termios *termios,
-                    struct termios *old)
+pl010_set_termios(struct uart_port *port, struct ktermios *termios,
+                    struct ktermios *old)
 {
        unsigned int lcr_h, old_cr;
        unsigned long flags;
@@ -596,6 +589,8 @@ static int __init pl010_console_setup(struct console *co, char *options)
         */
        if (co->index >= UART_NR)
                co->index = 0;
+       if (!amba_ports[co->index])
+               return -ENODEV;
        port = &amba_ports[co->index]->port;
 
        if (options)