Merge branch 'master' of git://git.denx.de/u-boot-nand-flash
[oweals/u-boot.git] / drivers / usb / gadget / s3c_udc_otg_xfer_dma.c
index d7af5e9034d18ce13ac5453da8c283cb5b2c57b7..1cbf8f60a7ace1877f569eb23217d7bf3f7b6df7 100644 (file)
@@ -117,7 +117,8 @@ static int setdma_rx(struct s3c_ep *ep, struct s3c_request *req)
 
        invalidate_dcache_range((unsigned long) ep->dev->dma_buf[ep_num],
                                (unsigned long) ep->dev->dma_buf[ep_num]
-                               + DMA_BUFFER_SIZE);
+                               + ROUND(ep->ep.maxpacket,
+                                       CONFIG_SYS_CACHELINE_SIZE));
 
        if (length == 0)
                pktcnt = 1;