mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
tty: Use termios c_*flag macros
Expressions of the form "tty->termios.c_*flag & FLAG" are more clearly expressed with the termios flags macros, I_FLAG(), C_FLAG(), O_FLAG(), and L_FLAG(). Convert treewide. Signed-off-by: Peter Hurley <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
5823323ea5
commit
9db276f8f0
28 changed files with 113 additions and 161 deletions
|
|
@ -287,14 +287,14 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
|
|||
|
||||
if (filp->f_flags & O_NONBLOCK) {
|
||||
/* nonblock mode is set */
|
||||
if (tty->termios.c_cflag & CBAUD)
|
||||
if (C_BAUD(tty))
|
||||
tty_port_raise_dtr_rts(port);
|
||||
port->flags |= ASYNC_NORMAL_ACTIVE;
|
||||
pr_debug("%s(), O_NONBLOCK requested!\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (tty->termios.c_cflag & CLOCAL) {
|
||||
if (C_CLOCAL(tty)) {
|
||||
pr_debug("%s(), doing CLOCAL!\n", __func__);
|
||||
do_clocal = 1;
|
||||
}
|
||||
|
|
@ -806,7 +806,7 @@ static void ircomm_tty_throttle(struct tty_struct *tty)
|
|||
ircomm_tty_send_xchar(tty, STOP_CHAR(tty));
|
||||
|
||||
/* Hardware flow control? */
|
||||
if (tty->termios.c_cflag & CRTSCTS) {
|
||||
if (C_CRTSCTS(tty)) {
|
||||
self->settings.dte &= ~IRCOMM_RTS;
|
||||
self->settings.dte |= IRCOMM_DELTA_RTS;
|
||||
|
||||
|
|
@ -831,12 +831,11 @@ static void ircomm_tty_unthrottle(struct tty_struct *tty)
|
|||
IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;);
|
||||
|
||||
/* Using software flow control? */
|
||||
if (I_IXOFF(tty)) {
|
||||
if (I_IXOFF(tty))
|
||||
ircomm_tty_send_xchar(tty, START_CHAR(tty));
|
||||
}
|
||||
|
||||
/* Using hardware flow control? */
|
||||
if (tty->termios.c_cflag & CRTSCTS) {
|
||||
if (C_CRTSCTS(tty)) {
|
||||
self->settings.dte |= (IRCOMM_RTS|IRCOMM_DELTA_RTS);
|
||||
|
||||
ircomm_param_request(self, IRCOMM_DTE, TRUE);
|
||||
|
|
|
|||
|
|
@ -158,26 +158,21 @@ void ircomm_tty_set_termios(struct tty_struct *tty,
|
|||
ircomm_tty_change_speed(self, tty);
|
||||
|
||||
/* Handle transition to B0 status */
|
||||
if ((old_termios->c_cflag & CBAUD) &&
|
||||
!(cflag & CBAUD)) {
|
||||
if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) {
|
||||
self->settings.dte &= ~(IRCOMM_DTR|IRCOMM_RTS);
|
||||
ircomm_param_request(self, IRCOMM_DTE, TRUE);
|
||||
}
|
||||
|
||||
/* Handle transition away from B0 status */
|
||||
if (!(old_termios->c_cflag & CBAUD) &&
|
||||
(cflag & CBAUD)) {
|
||||
if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) {
|
||||
self->settings.dte |= IRCOMM_DTR;
|
||||
if (!(tty->termios.c_cflag & CRTSCTS) ||
|
||||
!test_bit(TTY_THROTTLED, &tty->flags)) {
|
||||
if (!C_CRTSCTS(tty) || !test_bit(TTY_THROTTLED, &tty->flags))
|
||||
self->settings.dte |= IRCOMM_RTS;
|
||||
}
|
||||
ircomm_param_request(self, IRCOMM_DTE, TRUE);
|
||||
}
|
||||
|
||||
/* Handle turning off CRTSCTS */
|
||||
if ((old_termios->c_cflag & CRTSCTS) &&
|
||||
!(tty->termios.c_cflag & CRTSCTS))
|
||||
if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty))
|
||||
{
|
||||
tty->hw_stopped = 0;
|
||||
ircomm_tty_start(tty);
|
||||
|
|
|
|||
Loading…
Reference in a new issue