From 31cde0447d779c1b4ae9feb51dc917d6e287de2b Mon Sep 17 00:00:00 2001 From: Paul Walmsley Date: Fri, 13 Apr 2012 06:34:31 -0600 Subject: ARM: OMAP1: board files: deduplicate and clean some NAND-related code The H2, H3, Perseus2, and FSample board files all contain the same duplicated code to handle NAND commands. That code is missing some casts around conversions from unsigned long to void __iomem *. Consolidate the duplicated code into a new file, arch/arm/mach-omap1/board-nand.c. Resolve the sparse warnings by adding appropriate casts: arch/arm/mach-omap1/board-h2.c:193:9: warning: incorrect type in argument 1 (different base types) arch/arm/mach-omap1/board-h2.c:193:9: expected void const volatile [noderef] * arch/arm/mach-omap1/board-h2.c:193:9: got unsigned long arch/arm/mach-omap1/board-perseus2.c:157:9: warning: incorrect type in argument 1 (different base types) arch/arm/mach-omap1/board-perseus2.c:157:9: expected void const volatile [noderef] * arch/arm/mach-omap1/board-perseus2.c:157:9: got unsigned long arch/arm/mach-omap1/board-fsample.c:199:9: warning: incorrect type in argument 1 (different base types) arch/arm/mach-omap1/board-fsample.c:199:9: expected void const volatile [noderef] * arch/arm/mach-omap1/board-fsample.c:199:9: got unsigned long arch/arm/mach-omap1/board-h3.c:195:9: warning: incorrect type in argument 1 (different base types) arch/arm/mach-omap1/board-h3.c:195:9: expected void const volatile [noderef] * arch/arm/mach-omap1/board-h3.c:195:9: got unsigned long Thanks to Arnd Bergmann for suggesting a cleaner implementation of omap1_nand_cmd_ctl(), avoiding some casts. Signed-off-by: Paul Walmsley Cc: Brian Swetland Cc: Imre Deak Cc: Greg Lonnon Cc: Kevin Hilman Cc: Kevin Hilman Cc: Arnd Bergmann --- arch/arm/mach-omap1/board-h3.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'arch/arm/mach-omap1/board-h3.c') diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 4c19f4c06851..f6ddf8759657 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c @@ -181,20 +181,6 @@ static struct mtd_partition nand_partitions[] = { }, }; -static void nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) -{ - struct nand_chip *this = mtd->priv; - unsigned long mask; - - if (cmd == NAND_CMD_NONE) - return; - - mask = (ctrl & NAND_CLE) ? 0x02 : 0; - if (ctrl & NAND_ALE) - mask |= 0x04; - writeb(cmd, (unsigned long)this->IO_ADDR_W | mask); -} - #define H3_NAND_RB_GPIO_PIN 10 static int nand_dev_ready(struct mtd_info *mtd) @@ -214,7 +200,7 @@ static struct platform_nand_data nand_platdata = { .part_probe_types = part_probes, }, .ctrl = { - .cmd_ctrl = nand_cmd_ctl, + .cmd_ctrl = omap1_nand_cmd_ctl, .dev_ready = nand_dev_ready, }, -- cgit v1.2.3-59-g8ed1b