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 4be603783c04763ef4d7b6d3a36787cfbb5d24b0..1cbf8f60a7ace1877f569eb23217d7bf3f7b6df7 100644 (file)
  * Marek Szyprowski <m.szyprowski@samsung.com>
  * Lukasz Majewski <l.majewski@samsumg.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
+ * SPDX-License-Identifier:    GPL-2.0+
  */
 
 static u8 clear_feature_num;
@@ -130,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;