Commit 2479e2a9 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

USB: cp210x: forward USB errors to USB serial core

Make sure we forward all error codes (e.g. ENOMEM) to USB serial core.
Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 06946a66
...@@ -280,7 +280,10 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request, ...@@ -280,7 +280,10 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
dbg("%s - Unable to send config request, " dbg("%s - Unable to send config request, "
"request=0x%x size=%d result=%d\n", "request=0x%x size=%d result=%d\n",
__func__, request, size, result); __func__, request, size, result);
return -EPROTO; if (result > 0)
result = -EPROTO;
return result;
} }
return 0; return 0;
...@@ -331,7 +334,10 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request, ...@@ -331,7 +334,10 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
dbg("%s - Unable to send request, " dbg("%s - Unable to send request, "
"request=0x%x size=%d result=%d\n", "request=0x%x size=%d result=%d\n",
__func__, request, size, result); __func__, request, size, result);
return -EPROTO; if (result > 0)
result = -EPROTO;
return result;
} }
return 0; return 0;
...@@ -395,10 +401,11 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port) ...@@ -395,10 +401,11 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
dbg("%s - port %d", __func__, port->number); dbg("%s - port %d", __func__, port->number);
if (cp210x_set_config_single(port, CP210X_IFC_ENABLE, UART_ENABLE)) { result = cp210x_set_config_single(port, CP210X_IFC_ENABLE,
dev_err(&port->dev, "%s - Unable to enable UART\n", UART_ENABLE);
__func__); if (result) {
return -EPROTO; dev_err(&port->dev, "%s - Unable to enable UART\n", __func__);
return result;
} }
result = usb_serial_generic_open(tty, port); result = usb_serial_generic_open(tty, port);
......
Markdown is supported
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