diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2016-04-09 17:53:23 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-30 09:26:55 -0700 |
commit | 2d68655d15bc99981394f7caa769a14b03cac131 (patch) | |
tree | a61f1f9ffe92c21ff69fdd3f09c8f921f0670fcf /drivers/tty/synclink.c | |
parent | 807c8d81f4ec441241cafa3034c58df721fee869 (diff) | |
download | linux-stable-2d68655d15bc99981394f7caa769a14b03cac131.tar.gz linux-stable-2d68655d15bc99981394f7caa769a14b03cac131.tar.bz2 linux-stable-2d68655d15bc99981394f7caa769a14b03cac131.zip |
tty: Replace ASYNC_CHECK_CD and update atomically
Replace ASYNC_CHECK_CD bit in the tty_port::flags field with
TTY_PORT_CHECK_CD bit in the tty_port::iflags field. Introduce helpers
tty_port_set_check_carrier() and tty_port_check_carrier() to abstract
the atomic bit ops.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/synclink.c')
-rw-r--r-- | drivers/tty/synclink.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c index b55f8468cde5..b67b54a800bb 100644 --- a/drivers/tty/synclink.c +++ b/drivers/tty/synclink.c @@ -1340,7 +1340,7 @@ static void mgsl_isr_io_pin( struct mgsl_struct *info ) wake_up_interruptible(&info->status_event_wait_q); wake_up_interruptible(&info->event_wait_q); - if ( (info->port.flags & ASYNC_CHECK_CD) && + if (tty_port_check_carrier(&info->port) && (status & MISCSTATUS_DCD_LATCHED) ) { if ( debug_level >= DEBUG_LEVEL_ISR ) printk("%s CD now %s...", info->device_name, @@ -1967,11 +1967,7 @@ static void mgsl_change_params(struct mgsl_struct *info) info->timeout += HZ/50; /* Add .02 seconds of slop */ tty_port_set_cts_flow(&info->port, cflag & CRTSCTS); - - if (cflag & CLOCAL) - info->port.flags &= ~ASYNC_CHECK_CD; - else - info->port.flags |= ASYNC_CHECK_CD; + tty_port_set_check_carrier(&info->port, ~cflag & CLOCAL); /* process tty input control flags */ |