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, ...@@ -1164,10 +1164,8 @@ static int cp210x_set_chars(struct usb_serial_port *port,
kfree(dmabuf); kfree(dmabuf);
if (result < 0) { if (result < 0)
dev_err(&port->dev, "failed to set special chars: %d\n", result);
return result; return result;
return 0; return 0;
} }
...@@ -1219,8 +1217,10 @@ static void cp210x_set_flow_control(struct tty_struct *tty, ...@@ -1219,8 +1217,10 @@ static void cp210x_set_flow_control(struct tty_struct *tty,
chars.bXoffChar = STOP_CHAR(tty); chars.bXoffChar = STOP_CHAR(tty);
ret = cp210x_set_chars(port, &chars); ret = cp210x_set_chars(port, &chars);
if (ret) if (ret) {
return; dev_err(&port->dev, "failed to set special chars: %d\n",
} }
mutex_lock(&port_priv->mutex); mutex_lock(&port_priv->mutex);
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