usb: musb: gadget: complete request only if data is transfered over
Complete the current request only if the data transfer is over. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Anand Gadiyar <gadiyar@ti.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1018b4e44f
commit
bb27bc2c11
@@ -501,9 +501,8 @@ void musb_g_tx(struct musb *musb, u8 epnum)
|
|||||||
request->zero = 0;
|
request->zero = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ... or if not, then complete it. */
|
if (request->actual == request->length) {
|
||||||
musb_g_giveback(musb_ep, request, 0);
|
musb_g_giveback(musb_ep, request, 0);
|
||||||
|
|
||||||
request = musb_ep->desc ? next_request(musb_ep) : NULL;
|
request = musb_ep->desc ? next_request(musb_ep) : NULL;
|
||||||
if (!request) {
|
if (!request) {
|
||||||
DBG(4, "%s idle now\n",
|
DBG(4, "%s idle now\n",
|
||||||
@@ -511,6 +510,7 @@ void musb_g_tx(struct musb *musb, u8 epnum)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
txstate(musb, to_musb_request(request));
|
txstate(musb, to_musb_request(request));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user