tty: Replace ASYNC_INITIALIZED bit and update atomically
[deliverable/linux.git] / drivers / tty / rocket.c
index eb8311b20782ce4f18e68e0236114d14eba556d6..7f3b1db8806130b165e823744cb9a6f3f9568beb 100644 (file)
@@ -495,7 +495,7 @@ static void rp_handle_port(struct r_port *info)
        if (!info)
                return;
 
-       if ((info->port.flags & ASYNC_INITIALIZED) == 0) {
+       if (!tty_port_initialized(&info->port)) {
                printk(KERN_WARNING "rp: WARNING: rp_handle_port called with "
                                "info->flags & NOT_INIT\n");
                return;
@@ -920,7 +920,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
        /*
         * Info->count is now 1; so it's safe to sleep now.
         */
-       if (!test_bit(ASYNCB_INITIALIZED, &port->flags)) {
+       if (!tty_port_initialized(port)) {
                cp = &info->channel;
                sSetRxTrigger(cp, TRIG_1);
                if (sGetChanStatus(cp) & CD_ACT)
@@ -944,7 +944,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
                sEnRxFIFO(cp);
                sEnTransmit(cp);
 
-               set_bit(ASYNCB_INITIALIZED, &info->port.flags);
+               tty_port_set_initialized(&info->port, 1);
 
                /*
                 * Set up the tty->alt_speed kludge
@@ -1042,9 +1042,9 @@ static void rp_close(struct tty_struct *tty, struct file *filp)
                }
        }
        spin_lock_irq(&port->lock);
-       port->flags &= ~ASYNC_INITIALIZED;
        tty->closing = 0;
        spin_unlock_irq(&port->lock);
+       tty_port_set_initialized(port, 0);
        tty_port_set_active(port, 0);
        mutex_unlock(&port->mutex);
        tty_port_tty_set(port, NULL);
@@ -1513,7 +1513,7 @@ static void rp_hangup(struct tty_struct *tty)
        sDisCTSFlowCtl(cp);
        sDisTxSoftFlowCtl(cp);
        sClrTxXOFF(cp);
-       clear_bit(ASYNCB_INITIALIZED, &info->port.flags);
+       tty_port_set_initialized(&info->port, 0);
 
        wake_up_interruptible(&info->port.open_wait);
 }
This page took 0.024584 seconds and 5 git commands to generate.