usb: Fix error handling in musb_hcd.c
authorAndrew Murray <amurray@embedded-bits.co.uk>
Tue, 1 Oct 2013 14:58:56 +0000 (15:58 +0100)
committerTom Rini <trini@ti.com>
Mon, 7 Oct 2013 11:43:46 +0000 (07:43 -0400)
commitddd025bb6e283744dc93d3653a0b6fbd5c35e904
tree6163e25243a8ff5a2a40799cceb6f7a7e516cd42
parent6478cde618ad3bfdb9b62f62e8c76498b0d6637f
usb: Fix error handling in musb_hcd.c

The wait_until_[rx|tx]ep_ready functions return a u8 to indicate success
containing the value 0, 1 or -1. This patch changes the return type to an
int to accommodate the negative return values.

These functions are used in the file using calls such as if (!wait_until...
Where a -1 is returned it is mishandled and treated as success instead of
a CRC error. This patch addresses this.

Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
Signed-off-by: Andrew Murray <amurray@embedded-bits.co.uk>
Acked-by: Marek Vasut <marex@denx.de>
drivers/usb/musb/musb_hcd.c