diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/serial_core.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index a55751a12c38..3d2acc2265f7 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -1520,8 +1520,16 @@ static void uart_dtr_rts(struct tty_port *port, int onoff) | |||
1520 | struct uart_state *state = container_of(port, struct uart_state, port); | 1520 | struct uart_state *state = container_of(port, struct uart_state, port); |
1521 | struct uart_port *uport = state->uart_port; | 1521 | struct uart_port *uport = state->uart_port; |
1522 | 1522 | ||
1523 | if (onoff) | 1523 | if (onoff) { |
1524 | uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); | 1524 | uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS); |
1525 | |||
1526 | /* | ||
1527 | * If this is the first open to succeed, | ||
1528 | * adjust things to suit. | ||
1529 | */ | ||
1530 | if (!test_and_set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags)) | ||
1531 | uart_update_termios(port->tty, state); | ||
1532 | } | ||
1525 | else | 1533 | else |
1526 | uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); | 1534 | uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS); |
1527 | } | 1535 | } |
@@ -1636,15 +1644,6 @@ static int uart_open(struct tty_struct *tty, struct file *filp) | |||
1636 | if (retval == 0) | 1644 | if (retval == 0) |
1637 | retval = tty_port_block_til_ready(port, tty, filp); | 1645 | retval = tty_port_block_til_ready(port, tty, filp); |
1638 | 1646 | ||
1639 | /* | ||
1640 | * If this is the first open to succeed, adjust things to suit. | ||
1641 | */ | ||
1642 | if (retval == 0 && !(port->flags & ASYNC_NORMAL_ACTIVE)) { | ||
1643 | set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags); | ||
1644 | |||
1645 | uart_update_termios(tty, state); | ||
1646 | } | ||
1647 | |||
1648 | fail: | 1647 | fail: |
1649 | return retval; | 1648 | return retval; |
1650 | } | 1649 | } |