vserver 1.9.3
[linux-2.6.git] / drivers / char / amiserial.c
index 3dc61d4..f11cf4e 100644 (file)
@@ -118,10 +118,6 @@ static struct serial_state rs_table[1];
 
 #define NR_PORTS       (sizeof(rs_table)/sizeof(struct serial_state))
 
-#ifndef MIN
-#define MIN(a,b)       ((a) < (b) ? (a) : (b))
-#endif
-
 /*
  * tmp_buf is used as a temporary buffer by serial_write.  We need to
  * lock it in case the copy_from_user blocks while swapping in a page,
@@ -430,7 +426,7 @@ static _INLINE_ void check_modem_status(struct async_struct *info)
 
        if ((info->flags & ASYNC_CHECK_CD) && (dstatus & SER_DCD)) {
 #if (defined(SERIAL_DEBUG_OPEN) || defined(SERIAL_DEBUG_INTR))
-               printk("ttyS%02d CD now %s...", info->line,
+               printk("ttyS%d CD now %s...", info->line,
                       (!(status & SER_DCD)) ? "on" : "off");
 #endif
                if (!(status & SER_DCD))
@@ -557,9 +553,7 @@ static void do_softint(unsigned long private_)
                return;
 
        if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) {
-               if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-                   tty->ldisc.write_wakeup)
-                       (tty->ldisc.write_wakeup)(tty);
+               tty_wakeup(tty);
                wake_up_interruptible(&tty->write_wait);
        }
 }
@@ -1023,9 +1017,7 @@ static void rs_flush_buffer(struct tty_struct *tty)
        info->xmit.head = info->xmit.tail = 0;
        local_irq_restore(flags);
        wake_up_interruptible(&tty->write_wait);
-       if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-           tty->ldisc.write_wakeup)
-               (tty->ldisc.write_wakeup)(tty);
+       tty_wakeup(tty);
 }
 
 /*
@@ -1564,8 +1556,8 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
        shutdown(info);
        if (tty->driver->flush_buffer)
                tty->driver->flush_buffer(tty);
-       if (tty->ldisc.flush_buffer)
-               tty->ldisc.flush_buffer(tty);
+               
+       tty_ldisc_flush(tty);
        tty->closing = 0;
        info->event = 0;
        info->tty = 0;
@@ -1610,7 +1602,7 @@ static void rs_wait_until_sent(struct tty_struct *tty, int timeout)
        if (char_time == 0)
                char_time = 1;
        if (timeout)
-         char_time = MIN(char_time, timeout);
+         char_time = min_t(unsigned long, char_time, timeout);
        /*
         * If the transmitter hasn't cleared in twice the approximate
         * amount of time to send the entire FIFO, it probably won't
@@ -2095,7 +2087,7 @@ static int __init rs_init(void)
          continue;
        */
 
-       printk(KERN_INFO "ttyS%02d is the amiga builtin serial port\n",
+       printk(KERN_INFO "ttyS%d is the amiga builtin serial port\n",
                       state->line);
 
        /* Hardware set up */