Commit 363715ae authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

USB: serial: cp210x: fix control-characters error handling

commit 2d9a0070 upstream.

In the unlikely event that setting the software flow-control characters
fails the other flow-control settings should still be updated (just like
all other terminal settings).

Move out the error message printed by the set_chars() helper to make it
more obvious that this is intentional.

Fixes: 7748feff

 ("USB: serial: cp210x: add support for software flow control")
Cc:	# 5.11
Reviewed-by: default avatarGreg Kroah-Hartman <>
Signed-off-by: default avatarJohan Hovold <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 8c3084b2
......@@ -1164,10 +1164,8 @@ static int cp210x_set_chars(struct usb_serial_port *port,
if (result < 0) {
dev_err(&port->dev, "failed to set special chars: %d\n", result);
if (result < 0)
return result;
return 0;
......@@ -1219,8 +1217,10 @@ static void cp210x_set_flow_control(struct tty_struct *tty,
chars.bXoffChar = STOP_CHAR(tty);
ret = cp210x_set_chars(port, &chars);
if (ret)
if (ret) {
dev_err(&port->dev, "failed to set special chars: %d\n",
Supports Markdown
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