aboutsummaryrefslogtreecommitdiff
path: root/drivers/mtd/cfi_mtd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/cfi_mtd.c')
-rw-r--r--drivers/mtd/cfi_mtd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c
index a5bb0962e55..78293caa2f7 100644
--- a/drivers/mtd/cfi_mtd.c
+++ b/drivers/mtd/cfi_mtd.c
@@ -6,6 +6,7 @@
*/
#include <common.h>
+#include <dma.h>
#include <flash.h>
#include <malloc.h>
@@ -70,7 +71,8 @@ static int cfi_mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
flash_info_t *fi = mtd->priv;
u_char *f = (u_char*)(fi->start[0]) + from;
- memcpy(buf, f, len);
+ if (dma_memcpy(buf, f, len) < 0)
+ memcpy(buf, f, len);
*retlen = len;
return 0;