struct uart_state *state = container_of(port, struct uart_state, port);
struct uart_port *uport = state->uart_port;
- if (onoff)
+ if (onoff) {
uart_set_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
+
+ /*
+ * If this is the first open to succeed,
+ * adjust things to suit.
+ */
+ if (!test_and_set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags))
+ uart_update_termios(port->tty, state);
+ }
else
uart_clear_mctrl(uport, TIOCM_DTR | TIOCM_RTS);
}
if (retval == 0)
retval = tty_port_block_til_ready(port, tty, filp);
- /*
- * If this is the first open to succeed, adjust things to suit.
- */
- if (retval == 0 && !(port->flags & ASYNC_NORMAL_ACTIVE)) {
- set_bit(ASYNCB_NORMAL_ACTIVE, &port->flags);
-
- uart_update_termios(tty, state);
- }
-
fail:
return retval;
}