usb: dwc3: gadget: Handle TRB index 0 when full or empty
authorJohn Youn <johnyoun@synopsys.com>
Fri, 20 May 2016 00:26:17 +0000 (17:26 -0700)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 20 Jun 2016 09:32:45 +0000 (12:32 +0300)
commit361572b5f7a95b341a92d34b9bf41f71bbdae34d
tree9acd370326e26392f1bd933e5927923268f89546
parent7d0a038b130cde7265d6bbc5e148734cb127f341
usb: dwc3: gadget: Handle TRB index 0 when full or empty

If the trb->enqueue == trb->dequeue, then it could be full or empty.
This could also happen at TRB index 0, so modify the check to handle
that condition. At index 0, the previous TRB is the one just before the
link TRB.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/gadget.c