Signed-off-by: Ronan Dalton <[email protected]>
Cc: Marek Vasut <[email protected]>
---
Changes for v2:
- This is a new patch in the patch set
common/usb.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/common/usb.c b/common/usb.c
index 6a4ad346f4b..1c139d86e90 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -278,15 +278,20 @@ int usb_bulk_msg(struct usb_device *dev, unsigned int
pipe,
{
if (len < 0)
return -EINVAL;
+
dev->status = USB_ST_NOT_PROC; /*not yet processed */
+
if (submit_bulk_msg(dev, pipe, data, len) < 0)
return -EIO;
+
while (timeout--) {
if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC))
break;
mdelay(1);
}
+
*actual_length = dev->act_len;
+
if (dev->status == 0)
return 0;
else
--
2.53.0