Commit 48298e50 authored by Mike Isely's avatar Mike Isely Committed by Greg Kroah-Hartman

cypress_m8: improve control endpoint error handling

Fix usb core function error return checks to look for negative errno
values, not positive errno values.  This bug had rendered those checks
useless.  Also remove attempted error recovery on control endpoints
for EPIPE - with control endpoints EPIPE does not indicate a halted
endpoint so trying to recover with usb_clear_halt() is not the correct
action.
Signed-off-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9aa8dae7
...@@ -367,9 +367,7 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m ...@@ -367,9 +367,7 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m
if (tries++ >= 3) if (tries++ >= 3)
break; break;
if (retval == EPIPE) } while (retval != 8 && retval != -ENODEV);
usb_clear_halt(port->serial->dev, 0x00);
} while (retval != 8 && retval != ENODEV);
if (retval != 8) if (retval != 8)
err("%s - failed sending serial line settings - %d", __FUNCTION__, retval); err("%s - failed sending serial line settings - %d", __FUNCTION__, retval);
...@@ -394,9 +392,7 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m ...@@ -394,9 +392,7 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m
if (tries++ >= 3) if (tries++ >= 3)
break; break;
if (retval == EPIPE) } while (retval != 5 && retval != -ENODEV);
usb_clear_halt(port->serial->dev, 0x00);
} while (retval != 5 && retval != ENODEV);
if (retval != 5) { if (retval != 5) {
err("%s - failed to retrieve serial line settings - %d", __FUNCTION__, retval); err("%s - failed to retrieve serial line settings - %d", __FUNCTION__, retval);
......
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