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>
void *data, unsigned short size, int timeout)
{
ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet, 1);
void *data, unsigned short size, int timeout)
{
ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet, 1);
if ((timeout == 0) && (!asynch_allowed)) {
/* request for a asynch control pipe is not allowed */
if ((timeout == 0) && (!asynch_allowed)) {
/* request for a asynch control pipe is not allowed */
request, requesttype, value, index, size);
dev->status = USB_ST_NOT_PROC; /*not yet processed */
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;
if (timeout == 0)
return (int)size;