mtd/drivers/mtd/maps sa1100-flash.c,1.45,1.46
Russell King
rmk at infradead.org
Mon Nov 1 08:12:27 EST 2004
Update of /home/cvs/mtd/drivers/mtd/maps
In directory phoenix.infradead.org:/tmp/cvs-serv27600
Modified Files:
sa1100-flash.c
Log Message:
Fix memory resouce handling.
Index: sa1100-flash.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/sa1100-flash.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- sa1100-flash.c 21 Oct 2004 12:28:50 -0000 1.45
+++ sa1100-flash.c 1 Nov 2004 13:12:24 -0000 1.46
@@ -921,7 +921,6 @@
char name[16];
struct map_info *map;
struct mtd_info *mtd;
- struct resource *res;
};
#define NR_SUBMTD 4
@@ -954,8 +953,8 @@
sa[i].map->name = sa[i].name;
sprintf(sa[i].name, "sa1100-%d", i);
- sa[i].res = request_mem_region(sa[i].base, sa[i].size, sa[i].name);
- if (!sa[i].res) {
+ if (!request_mem_region(sa[i].base, sa[i].size, sa[i].name)) {
+ i -= 1;
ret = -EBUSY;
break;
}
@@ -999,8 +998,7 @@
if (ret == -ENXIO) {
iounmap(sa[i].map->virt);
sa[i].map->virt = NULL;
- release_resource(sa[i].res);
- sa[i].res = NULL;
+ release_mem_region(sa[i].base, sa[i].size);
}
/*
@@ -1039,8 +1037,7 @@
map_destroy(sa[i].mtd);
if (sa[i].map->virt)
iounmap(sa[i].map->virt);
- if (sa[i].res)
- release_resource(sa[i].res);
+ release_mem_region(sa[i].base, sa[i].size);
} while (i--);
kfree(maps);
@@ -1065,8 +1062,7 @@
map_destroy(sa[i].mtd);
if (sa[i].map->virt)
iounmap(sa[i].map->virt);
- if (sa[i].res)
- release_resource(sa[i].res);
+ release_mem_region(sa[i].base, sa[i].size);
}
kfree(sa[0].map);
}
More information about the linux-mtd-cvs
mailing list