diff options
author | Paul Walmsley <paul@pwsan.com> | 2012-04-13 08:34:31 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-04-13 08:34:31 -0400 |
commit | 31cde0447d779c1b4ae9feb51dc917d6e287de2b (patch) | |
tree | 5dcd6127f60a2319b28c57a594129499107bde70 /arch/arm/mach-omap1/board-h2.c | |
parent | 6cc1a7387d94deda3267f8a75c668fe679f09b2c (diff) |
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] <asn:2>*<noident>
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] <asn:2>*<noident>
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] <asn:2>*<noident>
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] <asn:2>*<noident>
arch/arm/mach-omap1/board-h3.c:195:9: got unsigned long
Thanks to Arnd Bergmann <arnd@arndb.de> for suggesting a cleaner
implementation of omap1_nand_cmd_ctl(), avoiding some casts.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Brian Swetland <swetland@google.com>
Cc: Imre Deak <imre.deak@nokia.com>
Cc: Greg Lonnon <glonnon@ridgerun.com>
Cc: Kevin Hilman <kjh@hilman.org>
Cc: Kevin Hilman <khilman@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-omap1/board-h2.c')
-rw-r--r-- | arch/arm/mach-omap1/board-h2.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 553a2e535764..057ec13f0649 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -179,20 +179,6 @@ static struct mtd_partition h2_nand_partitions[] = { | |||
179 | }, | 179 | }, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | static void h2_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | ||
183 | { | ||
184 | struct nand_chip *this = mtd->priv; | ||
185 | unsigned long mask; | ||
186 | |||
187 | if (cmd == NAND_CMD_NONE) | ||
188 | return; | ||
189 | |||
190 | mask = (ctrl & NAND_CLE) ? 0x02 : 0; | ||
191 | if (ctrl & NAND_ALE) | ||
192 | mask |= 0x04; | ||
193 | writeb(cmd, (unsigned long)this->IO_ADDR_W | mask); | ||
194 | } | ||
195 | |||
196 | #define H2_NAND_RB_GPIO_PIN 62 | 182 | #define H2_NAND_RB_GPIO_PIN 62 |
197 | 183 | ||
198 | static int h2_nand_dev_ready(struct mtd_info *mtd) | 184 | static int h2_nand_dev_ready(struct mtd_info *mtd) |
@@ -212,9 +198,8 @@ static struct platform_nand_data h2_nand_platdata = { | |||
212 | .part_probe_types = h2_part_probes, | 198 | .part_probe_types = h2_part_probes, |
213 | }, | 199 | }, |
214 | .ctrl = { | 200 | .ctrl = { |
215 | .cmd_ctrl = h2_nand_cmd_ctl, | 201 | .cmd_ctrl = omap1_nand_cmd_ctl, |
216 | .dev_ready = h2_nand_dev_ready, | 202 | .dev_ready = h2_nand_dev_ready, |
217 | |||
218 | }, | 203 | }, |
219 | }; | 204 | }; |
220 | 205 | ||