Title: [9119] trunk/drivers/mtd/maps/gpio-addr-flash.c: gpio-addr-flash: fix warnings and make more portable
Revision
9119
Author
vapier
Date
2010-08-31 15:24:39 -0400 (Tue, 31 Aug 2010)

Log Message

gpio-addr-flash: fix warnings and make more portable

as reported on lkml, building this module for HIMEM systems spews warnings
about mismatch in pointer types.  further, we need to use ioremap() in order
to access the flash memory rather than just accessing it directly.

Modified Paths

Diff

Modified: trunk/drivers/mtd/maps/gpio-addr-flash.c (9118 => 9119)


--- trunk/drivers/mtd/maps/gpio-addr-flash.c	2010-08-30 10:51:47 UTC (rev 9118)
+++ trunk/drivers/mtd/maps/gpio-addr-flash.c	2010-08-31 19:24:39 UTC (rev 9119)
@@ -208,10 +208,14 @@
 	if (!state)
 		return -ENOMEM;
 
+	/*
+	 * We cast start/end to known types in the boards file, so cast
+	 * away their pointer types here to the known types (gpios->xxx).
+	 */
 	state->gpio_count     = gpios->end;
-	state->gpio_addrs     = (void *)gpios->start;
+	state->gpio_addrs     = (void *)(unsigned long)gpios->start;
 	state->gpio_values    = (void *)(state + 1);
-	state->win_size       = memory->end - memory->start + 1;
+	state->win_size       = resource_size(memory);
 	memset(state->gpio_values, 0xff, arr_size);
 
 	state->map.name       = DRIVER_NAME;
@@ -221,7 +225,7 @@
 	state->map.copy_to    = gf_copy_to;
 	state->map.bankwidth  = pdata->width;
 	state->map.size       = state->win_size * (1 << state->gpio_count);
-	state->map.virt       = (void __iomem *)memory->start;
+	state->map.virt       = ioremap_nocache(memory->start, state->map.size);
 	state->map.phys       = NO_XIP;
 	state->map.map_priv_1 = (unsigned long)state;
 
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to