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>
Este commit está contenido en:
Peter Hurley
2016-04-09 17:53:23 -07:00
cometido por Greg Kroah-Hartman
padre 807c8d81f4
commit 2d68655d15
Se han modificado 13 ficheros con 39 adiciones y 64 borrados

Ver fichero

@@ -1043,11 +1043,7 @@ isdn_tty_change_speed(modem_info *info)
if (!(cflag & PARODD))
cval |= UART_LCR_EPAR;
if (cflag & CLOCAL)
port->flags &= ~ASYNC_CHECK_CD;
else {
port->flags |= ASYNC_CHECK_CD;
}
tty_port_set_check_carrier(port, ~cflag & CLOCAL);
}
static int
@@ -2526,7 +2522,7 @@ isdn_tty_modem_result(int code, modem_info *info)
if (info->closing || (!info->port.tty))
return;
if (info->port.flags & ASYNC_CHECK_CD)
if (tty_port_check_carrier(&info->port))
tty_hangup(info->port.tty);
}
}