Skip to content
Snippets Groups Projects
Commit 651d95c8 authored by Hans de Goede's avatar Hans de Goede Committed by Simon Glass
Browse files

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: default avatarHans de Goede <hdegoede@redhat.com>
parent 71b94526
No related branches found
No related tags found
No related merge requests found
...@@ -192,6 +192,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, ...@@ -192,6 +192,7 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
void *data, unsigned short size, int timeout) void *data, unsigned short size, int timeout)
{ {
ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet, 1); ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet, 1);
int err;
if ((timeout == 0) && (!asynch_allowed)) { if ((timeout == 0) && (!asynch_allowed)) {
/* request for a asynch control pipe is not 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, ...@@ -209,8 +210,9 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
request, requesttype, value, index, size); request, requesttype, value, index, size);
dev->status = USB_ST_NOT_PROC; /*not yet processed */ dev->status = USB_ST_NOT_PROC; /*not yet processed */
if (submit_control_msg(dev, pipe, data, size, setup_packet) < 0) err = submit_control_msg(dev, pipe, data, size, setup_packet);
return -EIO; if (err < 0)
return err;
if (timeout == 0) if (timeout == 0)
return (int)size; return (int)size;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment