usb: gadget: udc: net2280: Simplify scan_dma_completions
authorRicardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Fri, 28 Nov 2014 13:51:00 +0000 (14:51 +0100)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 Jan 2015 18:13:28 +0000 (12:13 -0600)
After fix superspeed dma_done was applied we can simplify the code by
removing the duplicated dma_done and letting the function check if there
are more completed dma transactions.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/net2280.c

index cc7618146e795381bd60a39992826d975fde12f4..a978e6e69eeda2624c321addd3147a7c80fa3ae0 100644 (file)
@@ -1051,9 +1051,8 @@ static void scan_dma_completions(struct net2280_ep *ep)
                        dma_done(ep, req, tmp, 0);
                        break;
                } else if (!ep->is_in &&
-                               (req->req.length % ep->ep.maxpacket) != 0) {
-                       if (ep->dev->quirks & PLX_SUPERSPEED)
-                               return dma_done(ep, req, tmp, 0);
+                          (req->req.length % ep->ep.maxpacket) &&
+                          !(ep->dev->quirks & PLX_SUPERSPEED)) {
 
                        tmp = readl(&ep->regs->ep_stat);
                        /* AVOID TROUBLE HERE by not issuing short reads from