mtd/drivers/mtd/maps amd76xrom.c,1.14,1.15
ebiederman at lnxi.com
ebiederman at lnxi.com
Fri Sep 17 02:28:01 EDT 2004
Update of /home/cvs/mtd/drivers/mtd/maps
In directory phoenix.infradead.org:/tmp/cvs-serv10336/drivers/mtd/maps
Modified Files:
amd76xrom.c
Log Message:
- Cleanup the new iomem semantics in ichxrom
Index: amd76xrom.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/amd76xrom.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- amd76xrom.c 16 Sep 2004 23:27:12 -0000 1.14
+++ amd76xrom.c 17 Sep 2004 06:27:59 -0000 1.15
@@ -29,7 +29,7 @@
#define ROM_PROBE_STEP_SIZE (64*1024) /* 64KiB */
struct amd76xrom_window {
- void *virt;
+ void __iomem *virt;
unsigned long phys;
unsigned long size;
struct list_head maps;
@@ -89,7 +89,7 @@
static char *rom_probe_types[] = { "cfi_probe", "jedec_probe", NULL };
u8 byte;
struct amd76xrom_window *window = &amd76xrom_window;
- struct amd76xrom_map_info *map;
+ struct amd76xrom_map_info *map = 0;
unsigned long map_top;
/* Remember the pci dev I find the window in */
@@ -145,14 +145,13 @@
window->virt = ioremap_nocache(window->phys, window->size);
if (!window->virt) {
printk(KERN_ERR MOD_NAME ": Failed to ioremap\n");
- goto failed;
+ goto out;
}
/* Get the first address to look for an rom chip at */
map_top = window->phys;
- /* Loop trhough adn look for rom chips */
- map = 0;
+ /* Loop through and look for rom chips */
while((map_top - 1) < 0xffffffffUL) {
struct cfi_private *cfi;
unsigned long offset;
@@ -163,20 +162,21 @@
}
if (!map) {
printk(KERN_ERR MOD_NAME ": kmalloc failed");
- goto failed;
+ goto out;
}
memset(map, 0, sizeof(*map));
INIT_LIST_HEAD(&map->list);
map->map.name = map->map_name;
map->map.phys = map_top;
offset = map_top - window->phys;
- map->map.virt = ((void __iomem *)(window->virt)) + offset;
+ map->map.virt = (void __iomem *)
+ (((unsigned long)(window->virt)) + offset);
map->map.size = 0xffffffffUL - map_top + 1UL;
/* Set the name of the map to the address I am trying */
sprintf(map->map_name, "%s @%08lx",
MOD_NAME, map->map.phys);
- /* There is not generic VPP support */
+ /* There is no generic VPP support */
for(map->map.bankwidth = 32; map->map.bankwidth;
map->map.bankwidth >>=1)
{
@@ -224,7 +224,7 @@
}
/* Make the whole region visible in the map */
- map->map.virt = (void __iomem *)(window->virt);
+ map->map.virt = window->virt;
map->map.phys = window->phys;
cfi = map->map.fldrv_priv;
for(i = 0; i < cfi->numchips; i++) {
@@ -244,15 +244,17 @@
map = 0;
}
+ out:
/* Free any left over map structures */
if (map) {
kfree(map);
}
+ /* See if I have any map structures */
+ if (list_empty(&window->maps)) {
+ amd76xrom_cleanup(window);
+ return -ENODEV;
+ }
return 0;
-
- failed:
- amd76xrom_cleanup(window);
- return -ENODEV;
}
More information about the linux-mtd-cvs
mailing list