diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-09-24 06:13:15 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-11-04 06:25:53 -0500 |
commit | dec94e70e12c39440e63159e0050d46795dfcf09 (patch) | |
tree | 23288ad3713e46ab71fcff90ea73b206b4c73919 /drivers/tty | |
parent | 8f0d8163b50e01f398b14bcd4dc039ac5ab18d64 (diff) |
SERIAL: core: use local variable uport in uart_set_termios()
This is to make the following change more clear.
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/serial_core.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 0fcfd98a9566..bc2065d323b9 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c | |||
@@ -1210,6 +1210,7 @@ static void uart_set_termios(struct tty_struct *tty, | |||
1210 | struct ktermios *old_termios) | 1210 | struct ktermios *old_termios) |
1211 | { | 1211 | { |
1212 | struct uart_state *state = tty->driver_data; | 1212 | struct uart_state *state = tty->driver_data; |
1213 | struct uart_port *uport = state->uart_port; | ||
1213 | unsigned long flags; | 1214 | unsigned long flags; |
1214 | unsigned int cflag = tty->termios.c_cflag; | 1215 | unsigned int cflag = tty->termios.c_cflag; |
1215 | 1216 | ||
@@ -1232,31 +1233,31 @@ static void uart_set_termios(struct tty_struct *tty, | |||
1232 | 1233 | ||
1233 | /* Handle transition to B0 status */ | 1234 | /* Handle transition to B0 status */ |
1234 | if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) | 1235 | if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) |
1235 | uart_clear_mctrl(state->uart_port, TIOCM_RTS | TIOCM_DTR); | 1236 | uart_clear_mctrl(uport, TIOCM_RTS | TIOCM_DTR); |
1236 | /* Handle transition away from B0 status */ | 1237 | /* Handle transition away from B0 status */ |
1237 | else if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { | 1238 | else if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { |
1238 | unsigned int mask = TIOCM_DTR; | 1239 | unsigned int mask = TIOCM_DTR; |
1239 | if (!(cflag & CRTSCTS) || | 1240 | if (!(cflag & CRTSCTS) || |
1240 | !test_bit(TTY_THROTTLED, &tty->flags)) | 1241 | !test_bit(TTY_THROTTLED, &tty->flags)) |
1241 | mask |= TIOCM_RTS; | 1242 | mask |= TIOCM_RTS; |
1242 | uart_set_mctrl(state->uart_port, mask); | 1243 | uart_set_mctrl(uport, mask); |
1243 | } | 1244 | } |
1244 | 1245 | ||
1245 | /* Handle turning off CRTSCTS */ | 1246 | /* Handle turning off CRTSCTS */ |
1246 | if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) { | 1247 | if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) { |
1247 | spin_lock_irqsave(&state->uart_port->lock, flags); | 1248 | spin_lock_irqsave(&uport->lock, flags); |
1248 | tty->hw_stopped = 0; | 1249 | tty->hw_stopped = 0; |
1249 | __uart_start(tty); | 1250 | __uart_start(tty); |
1250 | spin_unlock_irqrestore(&state->uart_port->lock, flags); | 1251 | spin_unlock_irqrestore(&uport->lock, flags); |
1251 | } | 1252 | } |
1252 | /* Handle turning on CRTSCTS */ | 1253 | /* Handle turning on CRTSCTS */ |
1253 | else if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { | 1254 | else if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { |
1254 | spin_lock_irqsave(&state->uart_port->lock, flags); | 1255 | spin_lock_irqsave(&uport->lock, flags); |
1255 | if (!(state->uart_port->ops->get_mctrl(state->uart_port) & TIOCM_CTS)) { | 1256 | if (!(uport->ops->get_mctrl(uport) & TIOCM_CTS)) { |
1256 | tty->hw_stopped = 1; | 1257 | tty->hw_stopped = 1; |
1257 | state->uart_port->ops->stop_tx(state->uart_port); | 1258 | uport->ops->stop_tx(uport); |
1258 | } | 1259 | } |
1259 | spin_unlock_irqrestore(&state->uart_port->lock, flags); | 1260 | spin_unlock_irqrestore(&uport->lock, flags); |
1260 | } | 1261 | } |
1261 | } | 1262 | } |
1262 | 1263 | ||