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

Ben Dooks ben-linux at fluff.org
Fri Nov 7 09:33:14 CET 2008


On Mon, Nov 03, 2008 at 02:24:05PM -0200, Werner Almesberger wrote:
> 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);
>  }

ok, I think using 'struct nand_chip' instead of s3c2410_nand_mtd_toinfo()
is probably going to be easier.
  
>  /* cpufreq driver support */
> 

-- 
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.




More information about the openmoko-kernel mailing list