V4L/DVB (4495): Fix "no data from ZL10353 based USB tuner" problem
[safe/jmp/linux-2.6] / drivers / serial / pxa.c
index ff5e630..a720953 100644 (file)
@@ -24,7 +24,6 @@
  * with the serial core maintainer satisfaction to appear soon.
  */
 
-#include <linux/config.h>
 
 #if defined(CONFIG_SERIAL_PXA_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -107,14 +106,6 @@ receive_chars(struct uart_pxa_port *up, int *status, struct pt_regs *regs)
        int max_count = 256;
 
        do {
-               if (unlikely(tty->flip.count >= TTY_FLIPBUF_SIZE)) {
-                       if (tty->low_latency)
-                               tty_flip_buffer_push(tty);
-                       /*
-                        * If this failed then we will throw away the
-                        * bytes but must do so to clear interrupts
-                        */
-               }
                ch = serial_in(up, UART_RX);
                flag = TTY_NORMAL;
                up->port.icount.rx++;
@@ -277,7 +268,6 @@ static unsigned int serial_pxa_get_mctrl(struct uart_port *port)
        unsigned char status;
        unsigned int ret;
 
-return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR;
        status = serial_in(up, UART_MSR);
 
        ret = 0;
@@ -361,7 +351,7 @@ static int serial_pxa_startup(struct uart_port *port)
        if (port->line == 3) /* HWUART */
                up->mcr |= UART_MCR_AFE;
        else
-       up->mcr = 0;
+               up->mcr = 0;
 
        /*
         * Allocate the IRQ
@@ -399,7 +389,7 @@ static int serial_pxa_startup(struct uart_port *port)
 
        /*
         * Finally, enable interrupts.  Note: Modem status interrupts
-        * are set via set_termios(), which will be occuring imminently
+        * are set via set_termios(), which will be occurring imminently
         * anyway, so we don't enable them here.
         */
        up->ier = UART_IER_RLSI | UART_IER_RDI | UART_IER_RTOIE | UART_IER_UUE;
@@ -627,6 +617,14 @@ static inline void wait_for_xmitr(struct uart_pxa_port *up)
        }
 }
 
+static void serial_pxa_console_putchar(struct uart_port *port, int ch)
+{
+       struct uart_pxa_port *up = (struct uart_pxa_port *)port;
+
+       wait_for_xmitr(up);
+       serial_out(up, UART_TX, ch);
+}
+
 /*
  * Print a string to the serial port trying not to disturb
  * any possible real use of the port...
@@ -638,30 +636,14 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
 {
        struct uart_pxa_port *up = &serial_pxa_ports[co->index];
        unsigned int ier;
-       int i;
 
        /*
-        *      First save the UER then disable the interrupts
+        *      First save the IER then disable the interrupts
         */
        ier = serial_in(up, UART_IER);
        serial_out(up, UART_IER, UART_IER_UUE);
 
-       /*
-        *      Now, do each character
-        */
-       for (i = 0; i < count; i++, s++) {
-               wait_for_xmitr(up);
-
-               /*
-                *      Send the character out.
-                *      If a LF, also do CR...
-                */
-               serial_out(up, UART_TX, *s);
-               if (*s == 10) {
-                       wait_for_xmitr(up);
-                       serial_out(up, UART_TX, 13);
-               }
-       }
+       uart_console_write(&up->port, s, count, serial_pxa_console_putchar);
 
        /*
         *      Finally, wait for transmitter to become empty
@@ -797,7 +779,6 @@ static struct uart_pxa_port serial_pxa_ports[] = {
 static struct uart_driver serial_pxa_reg = {
        .owner          = THIS_MODULE,
        .driver_name    = "PXA serial",
-       .devfs_name     = "tts/",
        .dev_name       = "ttyS",
        .major          = TTY_MAJOR,
        .minor          = 64,