Skip to content

Commit

Permalink
cypress_m8: improve control endpoint error handling
Browse files Browse the repository at this point in the history
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: Mike Isely <isely@pobox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Mike Isely authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent 9aa8dae commit 48298e5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/usb/serial/cypress_m8.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,7 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m
if (tries++ >= 3)
break;

if (retval == EPIPE)
usb_clear_halt(port->serial->dev, 0x00);
} while (retval != 8 && retval != ENODEV);
} while (retval != 8 && retval != -ENODEV);

if (retval != 8)
err("%s - failed sending serial line settings - %d", __FUNCTION__, retval);
Expand All @@ -394,9 +392,7 @@ static int cypress_serial_control (struct usb_serial_port *port, unsigned baud_m
if (tries++ >= 3)
break;

if (retval == EPIPE)
usb_clear_halt(port->serial->dev, 0x00);
} while (retval != 5 && retval != ENODEV);
} while (retval != 5 && retval != -ENODEV);

if (retval != 5) {
err("%s - failed to retrieve serial line settings - %d", __FUNCTION__, retval);
Expand Down

0 comments on commit 48298e5

Please sign in to comment.