mtd: mxc_nand: use __iowrite32_copy for 32 bit copy

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Dec 15 19:59:07 PST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=33a87a159cca9deb29b6b72e9aed9d6644b5d1c8
Commit:     33a87a159cca9deb29b6b72e9aed9d6644b5d1c8
Parent:     e8e6c875658c39624fc8cb4c6f3e1b6ab9ce1b6e
Author:     Koul, Vinod <vinod.koul at intel.com>
AuthorDate: Mon Oct 20 21:36:13 2014 +0530
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Nov 5 14:27:37 2014 -0800

    mtd: mxc_nand: use __iowrite32_copy for 32 bit copy
    
    The driver was also using own method to do 32bit copy, turns out
    we have a kernel API so use that instead
    
    Signed-off-by: Vinod Koul <vinod.koul at intel.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/mxc_nand.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index dba262b..23e0754 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -280,14 +280,10 @@ static void memcpy32_fromio(void *trg, const void __iomem  *src, size_t size)
 		*t++ = __raw_readl(s++);
 }
 
-static void memcpy32_toio(void __iomem *trg, const void *src, int size)
+static inline void memcpy32_toio(void __iomem *trg, const void *src, int size)
 {
-	int i;
-	u32 __iomem *t = trg;
-	const u32 *s = src;
-
-	for (i = 0; i < (size >> 2); i++)
-		__raw_writel(*s++, t++);
+	/* __iowrite32_copy use 32bit size values so divide by 4 */
+	__iowrite32_copy(trg, src, size / 4);
 }
 
 static int check_int_v3(struct mxc_nand_host *host)



More information about the linux-mtd-cvs mailing list