Skip to content

Commit

Permalink
usb: musb: gadget: complete request only if data is transfered over
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ming Lei authored and Greg Kroah-Hartman committed Sep 24, 2010
1 parent 1018b4e commit bb27bc2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/usb/musb/musb_gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,14 @@ void musb_g_tx(struct musb *musb, u8 epnum)
request->zero = 0;
}

/* ... or if not, then complete it. */
musb_g_giveback(musb_ep, request, 0);

request = musb_ep->desc ? next_request(musb_ep) : NULL;
if (!request) {
DBG(4, "%s idle now\n",
musb_ep->end_point.name);
return;
if (request->actual == request->length) {
musb_g_giveback(musb_ep, request, 0);
request = musb_ep->desc ? next_request(musb_ep) : NULL;
if (!request) {
DBG(4, "%s idle now\n",
musb_ep->end_point.name);
return;
}
}
}

Expand Down

0 comments on commit bb27bc2

Please sign in to comment.