public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] USB-CDC: wrong ep status used
@ 2010-08-11 21:41 Stefano Babic
  2010-08-12 10:13 ` Vitaly Kuzmichev
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Babic @ 2010-08-11 21:41 UTC (permalink / raw)
  To: u-boot

In case a status ep is requested, it is always allocated
a request for the ep0, instead of the correct one saved
in the dev structure.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 drivers/usb/gadget/ether.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 9f9b093..1481d76 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1731,14 +1731,14 @@ autoconf_fail:
 	/* ... and maybe likewise for status transfer */
 #if defined(DEV_CONFIG_CDC)
 	if (dev->status_ep) {
-		dev->stat_req = usb_ep_alloc_request(gadget->ep0, GFP_KERNEL);
-		dev->stat_req->buf = status_req;
+		dev->stat_req = usb_ep_alloc_request(dev->status_ep, GFP_KERNEL);
 		if (!dev->stat_req) {
 			dev->stat_req->buf=NULL;
-			usb_ep_free_request (gadget->ep0, dev->req);
+			usb_ep_free_request (dev->status_ep, dev->req);
 
 			goto fail;
 		}
+		dev->stat_req->buf = status_req;
 		dev->stat_req->context = NULL;
 	}
 #endif
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-13  9:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-11 21:41 [U-Boot] [PATCH] USB-CDC: wrong ep status used Stefano Babic
2010-08-12 10:13 ` Vitaly Kuzmichev
2010-08-12 12:28   ` Stefano Babic
2010-08-12 17:05     ` Sergei Shtylyov
2010-08-13  9:16       ` Vitaly Kuzmichev
2010-08-13  9:19         ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox