UPSTREAM: 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)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
commit5e8ec28765cd65b078c03d11a5e47e326f738def
tree393c7c49cea5d2c79e62480d79d305d0638cca39
parentbf8f5fbf04f17ac64b2cc4e87701a931e9922fe5
UPSTREAM: 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.

Change-Id: I17d5fd4e7592507dac08bef6c458ff14d7426461
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
(cherry picked from commit 361572b5f7a95b341a92d34b9bf41f71bbdae34d)
drivers/usb/dwc3/gadget.c