USB: serial: cp210x: clean up auto-RTS handling
Clear the RTS bits of the flow-control request before determining the new value when updating the settings. Signed-off-by: Johan Hovold <johan@kernel.org>
This commit is contained in:
parent
cf00ead0bd
commit
e2f2dea34c
@ -1163,9 +1163,9 @@ static void cp210x_set_flow_control(struct tty_struct *tty,
|
|||||||
else
|
else
|
||||||
ctl_hs |= CP210X_SERIAL_DTR_INACTIVE;
|
ctl_hs |= CP210X_SERIAL_DTR_INACTIVE;
|
||||||
|
|
||||||
|
flow_repl &= ~CP210X_SERIAL_RTS_MASK;
|
||||||
if (C_CRTSCTS(tty)) {
|
if (C_CRTSCTS(tty)) {
|
||||||
ctl_hs |= CP210X_SERIAL_CTS_HANDSHAKE;
|
ctl_hs |= CP210X_SERIAL_CTS_HANDSHAKE;
|
||||||
flow_repl &= ~CP210X_SERIAL_RTS_MASK;
|
|
||||||
if (port_priv->rts)
|
if (port_priv->rts)
|
||||||
flow_repl |= CP210X_SERIAL_RTS_FLOW_CTL;
|
flow_repl |= CP210X_SERIAL_RTS_FLOW_CTL;
|
||||||
else
|
else
|
||||||
@ -1173,7 +1173,6 @@ static void cp210x_set_flow_control(struct tty_struct *tty,
|
|||||||
port_priv->crtscts = true;
|
port_priv->crtscts = true;
|
||||||
} else {
|
} else {
|
||||||
ctl_hs &= ~CP210X_SERIAL_CTS_HANDSHAKE;
|
ctl_hs &= ~CP210X_SERIAL_CTS_HANDSHAKE;
|
||||||
flow_repl &= ~CP210X_SERIAL_RTS_MASK;
|
|
||||||
if (port_priv->rts)
|
if (port_priv->rts)
|
||||||
flow_repl |= CP210X_SERIAL_RTS_ACTIVE;
|
flow_repl |= CP210X_SERIAL_RTS_ACTIVE;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user