Commit dec94e70 authored by Russell King's avatar Russell King

SERIAL: core: use local variable uport in uart_set_termios()

This is to make the following change more clear.
Acked-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 8f0d8163
...@@ -1210,6 +1210,7 @@ static void uart_set_termios(struct tty_struct *tty, ...@@ -1210,6 +1210,7 @@ static void uart_set_termios(struct tty_struct *tty,
struct ktermios *old_termios) struct ktermios *old_termios)
{ {
struct uart_state *state = tty->driver_data; struct uart_state *state = tty->driver_data;
struct uart_port *uport = state->uart_port;
unsigned long flags; unsigned long flags;
unsigned int cflag = tty->termios.c_cflag; unsigned int cflag = tty->termios.c_cflag;
...@@ -1232,31 +1233,31 @@ static void uart_set_termios(struct tty_struct *tty, ...@@ -1232,31 +1233,31 @@ static void uart_set_termios(struct tty_struct *tty,
/* Handle transition to B0 status */ /* Handle transition to B0 status */
if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD))
uart_clear_mctrl(state->uart_port, TIOCM_RTS | TIOCM_DTR); uart_clear_mctrl(uport, TIOCM_RTS | TIOCM_DTR);
/* Handle transition away from B0 status */ /* Handle transition away from B0 status */
else if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { else if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) {
unsigned int mask = TIOCM_DTR; unsigned int mask = TIOCM_DTR;
if (!(cflag & CRTSCTS) || if (!(cflag & CRTSCTS) ||
!test_bit(TTY_THROTTLED, &tty->flags)) !test_bit(TTY_THROTTLED, &tty->flags))
mask |= TIOCM_RTS; mask |= TIOCM_RTS;
uart_set_mctrl(state->uart_port, mask); uart_set_mctrl(uport, mask);
} }
/* Handle turning off CRTSCTS */ /* Handle turning off CRTSCTS */
if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) { if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) {
spin_lock_irqsave(&state->uart_port->lock, flags); spin_lock_irqsave(&uport->lock, flags);
tty->hw_stopped = 0; tty->hw_stopped = 0;
__uart_start(tty); __uart_start(tty);
spin_unlock_irqrestore(&state->uart_port->lock, flags); spin_unlock_irqrestore(&uport->lock, flags);
} }
/* Handle turning on CRTSCTS */ /* Handle turning on CRTSCTS */
else if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { else if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) {
spin_lock_irqsave(&state->uart_port->lock, flags); spin_lock_irqsave(&uport->lock, flags);
if (!(state->uart_port->ops->get_mctrl(state->uart_port) & TIOCM_CTS)) { if (!(uport->ops->get_mctrl(uport) & TIOCM_CTS)) {
tty->hw_stopped = 1; tty->hw_stopped = 1;
state->uart_port->ops->stop_tx(state->uart_port); uport->ops->stop_tx(uport);
} }
spin_unlock_irqrestore(&state->uart_port->lock, flags); spin_unlock_irqrestore(&uport->lock, flags);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment