diff options
author | Hans de Goede <hdegoede@redhat.com> | 2015-05-10 14:10:14 +0200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-05-14 18:49:30 -0600 |
commit | 651d95c8eb987034c95f1966556fbc55727a87b3 (patch) | |
tree | e6916c0233377beee9751a5eacff9b634da599a9 /common | |
parent | 71b945267d3e412efe4540a9ee61886f5e1e1e4a (diff) | |
download | u-boot-imx-651d95c8eb987034c95f1966556fbc55727a87b3.zip u-boot-imx-651d95c8eb987034c95f1966556fbc55727a87b3.tar.gz u-boot-imx-651d95c8eb987034c95f1966556fbc55727a87b3.tar.bz2 |
usb: usb_control_msg() propagate controller error code
Propagate the error returned by submit_control_msg() rather then always
returning -EIO when the hcd code indicates an error.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/usb.c b/common/usb.c index 1b26bfa..20c614c 100644 --- a/common/usb.c +++ b/common/usb.c @@ -192,6 +192,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, void *data, unsigned short size, int timeout) { ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet, 1); + int err; if ((timeout == 0) && (!asynch_allowed)) { /* request for a asynch control pipe is not allowed */ @@ -209,8 +210,9 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, request, requesttype, value, index, size); dev->status = USB_ST_NOT_PROC; /*not yet processed */ - if (submit_control_msg(dev, pipe, data, size, setup_packet) < 0) - return -EIO; + err = submit_control_msg(dev, pipe, data, size, setup_packet); + if (err < 0) + return err; if (timeout == 0) return (int)size; |