aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/isicom.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2016-04-09 20:53:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-30 12:26:55 -0400
commitd41861ca19c9e96f12a4f1ebbc8255d00909a232 (patch)
tree4b09c15500d404b0b375469dd673f0bc8fd05f5f /drivers/tty/isicom.c
parent80f02d5424301bf4df195d09b1a664f394435851 (diff)
tty: Replace ASYNC_INITIALIZED bit and update atomically
Replace ASYNC_INITIALIZED bit in the tty_port::flags field with TTY_PORT_INITIALIZED bit in the tty_port::iflags field. Introduce helpers tty_port_set_initialized() and tty_port_initialized() to abstract atomic bit ops. Note: the transforms for test_and_set_bit() and test_and_clear_bit() are unnecessary as the state transitions are already mutually exclusive; the tty lock prevents concurrent open/close/hangup. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/isicom.c')
-rw-r--r--drivers/tty/isicom.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c
index 0b2bae1b2d55..b70187b46d9d 100644
--- a/drivers/tty/isicom.c
+++ b/drivers/tty/isicom.c
@@ -438,8 +438,8 @@ static void isicom_tx(unsigned long _data)
438 438
439 for (; count > 0; count--, port++) { 439 for (; count > 0; count--, port++) {
440 /* port not active or tx disabled to force flow control */ 440 /* port not active or tx disabled to force flow control */
441 if (!(port->port.flags & ASYNC_INITIALIZED) || 441 if (!tty_port_initialized(&port->port) ||
442 !(port->status & ISI_TXOK)) 442 !(port->status & ISI_TXOK))
443 continue; 443 continue;
444 444
445 txcount = min_t(short, TX_SIZE, port->xmit_cnt); 445 txcount = min_t(short, TX_SIZE, port->xmit_cnt);
@@ -553,7 +553,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
553 return IRQ_HANDLED; 553 return IRQ_HANDLED;
554 } 554 }
555 port = card->ports + channel; 555 port = card->ports + channel;
556 if (!(port->port.flags & ASYNC_INITIALIZED)) { 556 if (!tty_port_initialized(&port->port)) {
557 outw(0x0000, base+0x04); /* enable interrupts */ 557 outw(0x0000, base+0x04); /* enable interrupts */
558 spin_unlock(&card->card_lock); 558 spin_unlock(&card->card_lock);
559 return IRQ_HANDLED; 559 return IRQ_HANDLED;