improve something for fpga
authorluowei <lw@rock-chips.com>
Fri, 24 Sep 2010 14:05:57 +0000 (22:05 +0800)
committerluowei <lw@rock-chips.com>
Fri, 24 Sep 2010 14:07:12 +0000 (22:07 +0800)
drivers/fpga/spi_uart.c

index 4d44e0f8f0434115a1de32d38a3432fdf4299b46..38b0dd05682dd9a3c8056291ec7c4566e5774dfc 100755 (executable)
@@ -407,12 +407,8 @@ static void spi_uart_receive_chars(struct spi_uart *uart, unsigned int *status)
        int ret,count,stat = *status;\r
        int i = 0;\r
        unsigned char buf[SPI_UART_FIFO_LEN];\r
-       while (max_count >0)\r
+       while (stat & UART_LSR_DR)\r
        {\r
-               if((((stat >> 8) & 0x3f) != 0) && (!(stat & UART_LSR_DR)))\r
-               printk("%s:warning:no receive data but count =%d \n",__FUNCTION__,((stat >> 8) & 0x3f));\r
-               if(!(stat & UART_LSR_DR))\r
-                       break;\r
                ret = spi_in(port, UART_RX, SEL_UART);\r
                count = (ret >> 8) & 0x3f;      \r
                DBG("%s:count=%d\n",__FUNCTION__,count);\r
@@ -436,6 +432,7 @@ static void spi_uart_receive_chars(struct spi_uart *uart, unsigned int *status)
                }\r
                tty_flip_buffer_push(tty); \r
                DBG("\n");\r
+               stat = spi_in(port, UART_LSR, SEL_UART) & 0xff;\r
        }       \r
 \r
        DBG("\n");\r