Merge tag 'mmc-11-27-2019' of https://gitlab.denx.de/u-boot/custodians/u-boot-mmc
[oweals/u-boot.git] / arch / arm / include / asm / dma-mapping.h
index 287466800e4bfd4f1793e8a59d22ef65c86fbd8b..fc5b8f634d546dcc26503169a648d31127a95bb6 100644 (file)
@@ -1,9 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * (C) Copyright 2007
  * Stelian Pop <stelian@popies.net>
  * Lead Tech Design <www.leadtechdesign.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #ifndef __ASM_ARM_DMA_MAPPING_H
 #define __ASM_ARM_DMA_MAPPING_H
@@ -14,7 +13,7 @@
 
 static inline void *dma_alloc_coherent(size_t len, unsigned long *handle)
 {
-       *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len);
+       *handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, ROUND(len, ARCH_DMA_MINALIGN));
        return (void *)*handle;
 }