public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bit copy
@ 2014-10-20 16:06 Vinod Koul
  2014-10-20 16:06 ` [PATCH 2/2] mtd: mxc_nand: " Vinod Koul
  2014-10-21 10:03 ` [PATCH 1/2] mtd: atmel_nand: " Josh Wu
  0 siblings, 2 replies; 8+ messages in thread
From: Vinod Koul @ 2014-10-20 16:06 UTC (permalink / raw)
  To: linux-mtd, linux-kernel
  Cc: David Woodhouse, Brian Norris, Josh Wu, Jingoo Han,
	Ezequiel Garcia, Mark Brown, Nicolas Ferre,
	Bartlomiej Zolnierkiewicz, Herve Codina, Bo Shen, Fabio Estevam,
	Andrew Morton, Michael Grzeschik, Josh Triplett, Wei Yongjun,
	Huang Shijie, Michael Opdenacker, Vinod Koul

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@intel.com>
---
 drivers/mtd/nand/atmel_nand.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index e321c56..b03e80d 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -265,14 +265,10 @@ static void memcpy32_fromio(void *trg, const void __iomem  *src, size_t size)
 		*t++ = readl_relaxed(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++)
-		writel_relaxed(*s++, t++);
+	/* __iowrite32_copy use 32bit size values so divide by 4 */
+	__iowrite32_copy(trg, src, size/4);
 }
 
 /*
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-11-05 22:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-20 16:06 [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bit copy Vinod Koul
2014-10-20 16:06 ` [PATCH 2/2] mtd: mxc_nand: " Vinod Koul
2014-11-05 22:29   ` Brian Norris
2014-10-21 10:03 ` [PATCH 1/2] mtd: atmel_nand: " Josh Wu
2014-10-21 10:20   ` [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bitcopy Herve Codina
2014-10-21 10:35     ` Vinod Koul
2014-10-22  7:35       ` Josh Wu
2014-10-21 10:33   ` [PATCH 1/2] mtd: atmel_nand: use __iowrite32_copy for 32 bit copy Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox