vserver 1.9.3
[linux-2.6.git] / drivers / serial / 68360serial.c
index c8fa14e..cd2d62c 100644 (file)
@@ -700,12 +700,8 @@ static void do_softint(void *private_)
        if (!tty)
                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);
-               wake_up_interruptible(&tty->write_wait);
-       }
+       if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event))
+               tty_wakeup(tty);
 }
 
 
@@ -1152,10 +1148,7 @@ static void rs_360_flush_buffer(struct tty_struct *tty)
        /* There is nothing to "flush", whatever we gave the CPM
         * is on its way out.
         */
-       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);
        info->flags &= ~TX_WAKEUP;
 }
 
@@ -1650,7 +1643,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
        
        if (tty_hung_up_p(filp)) {
                DBG_CNT("before DEC-hung");
-               MOD_DEC_USE_COUNT;
                local_irq_restore(flags);
                return;
        }
@@ -1677,7 +1669,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
        }
        if (state->count) {
                DBG_CNT("before DEC-2");
-               MOD_DEC_USE_COUNT;
                local_irq_restore(flags);
                return;
        }
@@ -1718,8 +1709,7 @@ static void rs_360_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;
@@ -1732,7 +1722,6 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp)
        }
        info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
        wake_up_interruptible(&info->close_wait);
-       MOD_DEC_USE_COUNT;
        local_irq_restore(flags);
 }
 
@@ -1993,14 +1982,12 @@ static int rs_360_open(struct tty_struct *tty, struct file * filp)
        if (retval)
                return retval;
 
-       MOD_INC_USE_COUNT;
        retval = block_til_ready(tty, filp, info);
        if (retval) {
 #ifdef SERIAL_DEBUG_OPEN
                printk("rs_open returning after block_til_ready with %d\n",
                       retval);
 #endif
-               MOD_DEC_USE_COUNT;
                return retval;
        }
 
@@ -2476,6 +2463,7 @@ long console_360_init(long kmem_start, long kmem_end)
 static int     baud_idx;
 
 static struct tty_operations rs_360_ops = {
+       .owner = THIS_MODULE,
        .open = rs_360_open,
        .close = rs_360_close,
        .write = rs_360_write,
@@ -2596,7 +2584,7 @@ int rs_360_init(void)
                state->icount.rx = state->icount.tx = 0;
                state->icount.frame = state->icount.parity = 0;
                state->icount.overrun = state->icount.brk = 0;
-               printk(KERN_INFO "ttyS%02d at irq 0x%02x is an %s\n",
+               printk(KERN_INFO "ttyS%d at irq 0x%02x is an %s\n",
                       i, (unsigned int)(state->irq),
                       (state->smc_scc_num & NUM_IS_SCC) ? "SCC" : "SMC");