Merge branch 'master' of /home/trondmy/kernel/linux-2.6/
[powerpc.git] / drivers / serial / 68328serial.c
index 67e9afa..b88a7c1 100644 (file)
@@ -101,8 +101,6 @@ struct tty_driver *serial_driver;
 
 #define RS_ISR_PASS_LIMIT 256
 
-#define _INLINE_ inline
-
 static void change_speed(struct m68k_serial *info);
 
 /*
@@ -143,7 +141,6 @@ static int m68328_console_cbaud   = DEFAULT_CBAUD;
  * memory if large numbers of serial ports are open.
  */
 static unsigned char tmp_buf[SERIAL_XMIT_SIZE]; /* This is cheating */
-DECLARE_MUTEX(tmp_buf_sem);
 
 static inline int serial_paranoia_check(struct m68k_serial *info,
                                        char *name, const char *routine)
@@ -263,7 +260,7 @@ static void batten_down_hatches(void)
        /* Drop into the debugger */
 }
 
-static _INLINE_ void status_handle(struct m68k_serial *info, unsigned short status)
+static void status_handle(struct m68k_serial *info, unsigned short status)
 {
 #if 0
        if(status & DCD) {
@@ -290,11 +287,12 @@ static _INLINE_ void status_handle(struct m68k_serial *info, unsigned short stat
        return;
 }
 
-static _INLINE_ void receive_chars(struct m68k_serial *info, struct pt_regs *regs, unsigned short rx)
+static void receive_chars(struct m68k_serial *info, struct pt_regs *regs,
+                         unsigned short rx)
 {
        struct tty_struct *tty = info->tty;
        m68328_uart *uart = &uart_addr[info->line];
-       unsigned char ch;
+       unsigned char ch, flag;
 
        /*
         * This do { } while() loop will get ALL chars out of Rx FIFO 
@@ -332,37 +330,35 @@ static _INLINE_ void receive_chars(struct m68k_serial *info, struct pt_regs *reg
                /*
                 * Make sure that we do not overflow the buffer
                 */
-               if (tty->flip.count >= TTY_FLIPBUF_SIZE) {
-                       schedule_work(&tty->flip.work);
+               if (tty_request_buffer_room(tty, 1) == 0) {
+                       tty_schedule_flip(tty);
                        return;
                }
 
+               flag = TTY_NORMAL;
+
                if(rx & URX_PARITY_ERROR) {
-                       *tty->flip.flag_buf_ptr++ = TTY_PARITY;
+                       flag = TTY_PARITY;
                        status_handle(info, rx);
                } else if(rx & URX_OVRUN) {
-                       *tty->flip.flag_buf_ptr++ = TTY_OVERRUN;
+                       flag = TTY_OVERRUN;
                        status_handle(info, rx);
                } else if(rx & URX_FRAME_ERROR) {
-                       *tty->flip.flag_buf_ptr++ = TTY_FRAME;
+                       flag = TTY_FRAME;
                        status_handle(info, rx);
-               } else {
-                       *tty->flip.flag_buf_ptr++ = 0; /* XXX */
                }
-                *tty->flip.char_buf_ptr++ = ch;
-               tty->flip.count++;
-
+               tty_insert_flip_char(tty, ch, flag);
 #ifndef CONFIG_XCOPILOT_BUGS
        } while((rx = uart->urx.w) & URX_DATA_READY);
 #endif
 
-       schedule_work(&tty->flip.work);
+       tty_schedule_flip(tty);
 
 clear_and_exit:
        return;
 }
 
-static _INLINE_ void transmit_chars(struct m68k_serial *info)
+static void transmit_chars(struct m68k_serial *info)
 {
        m68328_uart *uart = &uart_addr[info->line];