[PATCH 2/3] s3c2440-nand-use-iomem.patch

Werner Almesberger werner at openmoko.org
Mon Nov 3 17:24:05 CET 2008


s3c2440-nand-use-iomem.patch

Using chip->IO_ADDR_R/IO_ADDR_W, which is __iomem, prevents the
compiler from needlessly reloading constant data.

Signed-off-by: Werner Almesberger <werner at openmoko.org>

---

Index: ktrack/drivers/mtd/nand/s3c2410.c
===================================================================
--- ktrack.orig/drivers/mtd/nand/s3c2410.c	2008-11-03 14:05:19.000000000 -0200
+++ ktrack/drivers/mtd/nand/s3c2410.c	2008-11-03 14:06:00.000000000 -0200
@@ -529,8 +529,8 @@
 
 static void s3c2440_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len)
 {
-	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
-	readsl(info->regs + S3C2440_NFDATA, buf, len >> 2);
+	struct nand_chip *chip = mtd->priv;
+	readsl(chip->IO_ADDR_R, buf, len >> 2);
 }
 
 static void s3c2410_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
@@ -541,8 +541,8 @@
 
 static void s3c2440_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
 {
-	struct s3c2410_nand_info *info = s3c2410_nand_mtd_toinfo(mtd);
-	writesl(info->regs + S3C2440_NFDATA, buf, len >> 2);
+	struct nand_chip *chip = mtd->priv;
+	writesl(chip->IO_ADDR_W, buf, len >> 2);
 }
 
 /* cpufreq driver support */



More information about the openmoko-kernel mailing list