diff options
author | Mike Frysinger <vapier@gentoo.org> | 2010-10-16 18:31:14 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-10-24 20:16:17 -0400 |
commit | ebd71e3a4861849054751779ff5ccd3fb29a1e0a (patch) | |
tree | 34be07813f01c5557b97c27f5201d748bd9e6842 /drivers/mtd | |
parent | 5954c47c2194abcdeeae5f752e64b7c75770dbd3 (diff) |
mtd: maps: 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 properly access the flash memory on most systems rather than just doing
it directly.
Reported-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/maps/gpio-addr-flash.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c index 32e89d773b4e..af5707a80205 100644 --- a/drivers/mtd/maps/gpio-addr-flash.c +++ b/drivers/mtd/maps/gpio-addr-flash.c | |||
@@ -208,10 +208,14 @@ static int __devinit gpio_flash_probe(struct platform_device *pdev) | |||
208 | if (!state) | 208 | if (!state) |
209 | return -ENOMEM; | 209 | return -ENOMEM; |
210 | 210 | ||
211 | /* | ||
212 | * We cast start/end to known types in the boards file, so cast | ||
213 | * away their pointer types here to the known types (gpios->xxx). | ||
214 | */ | ||
211 | state->gpio_count = gpios->end; | 215 | state->gpio_count = gpios->end; |
212 | state->gpio_addrs = (void *)gpios->start; | 216 | state->gpio_addrs = (void *)(unsigned long)gpios->start; |
213 | state->gpio_values = (void *)(state + 1); | 217 | state->gpio_values = (void *)(state + 1); |
214 | state->win_size = memory->end - memory->start + 1; | 218 | state->win_size = resource_size(memory); |
215 | memset(state->gpio_values, 0xff, arr_size); | 219 | memset(state->gpio_values, 0xff, arr_size); |
216 | 220 | ||
217 | state->map.name = DRIVER_NAME; | 221 | state->map.name = DRIVER_NAME; |
@@ -221,7 +225,7 @@ static int __devinit gpio_flash_probe(struct platform_device *pdev) | |||
221 | state->map.copy_to = gf_copy_to; | 225 | state->map.copy_to = gf_copy_to; |
222 | state->map.bankwidth = pdata->width; | 226 | state->map.bankwidth = pdata->width; |
223 | state->map.size = state->win_size * (1 << state->gpio_count); | 227 | state->map.size = state->win_size * (1 << state->gpio_count); |
224 | state->map.virt = (void __iomem *)memory->start; | 228 | state->map.virt = ioremap_nocache(memory->start, state->map.size); |
225 | state->map.phys = NO_XIP; | 229 | state->map.phys = NO_XIP; |
226 | state->map.map_priv_1 = (unsigned long)state; | 230 | state->map.map_priv_1 = (unsigned long)state; |
227 | 231 | ||