diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/devices/mtdram.c | 3 | ||||
-rw-r--r-- | drivers/mtd/ftl.c | 11 | ||||
-rw-r--r-- | drivers/mtd/maps/uclinux.c | 13 |
3 files changed, 6 insertions, 21 deletions
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c index bb713fed2f3..1443117fd8f 100644 --- a/drivers/mtd/devices/mtdram.c +++ b/drivers/mtd/devices/mtdram.c @@ -91,8 +91,7 @@ static void __exit cleanup_mtdram(void) { if (mtd_info) { del_mtd_device(mtd_info); - if (mtd_info->priv) - vfree(mtd_info->priv); + vfree(mtd_info->priv); kfree(mtd_info); } } diff --git a/drivers/mtd/ftl.c b/drivers/mtd/ftl.c index d9ab60b36fd..d32c1b3a8ce 100644 --- a/drivers/mtd/ftl.c +++ b/drivers/mtd/ftl.c @@ -1017,27 +1017,16 @@ static int ftl_writesect(struct mtd_blktrans_dev *dev, void ftl_freepart(partition_t *part) { - if (part->VirtualBlockMap) { vfree(part->VirtualBlockMap); part->VirtualBlockMap = NULL; - } - if (part->VirtualPageMap) { kfree(part->VirtualPageMap); part->VirtualPageMap = NULL; - } - if (part->EUNInfo) { kfree(part->EUNInfo); part->EUNInfo = NULL; - } - if (part->XferInfo) { kfree(part->XferInfo); part->XferInfo = NULL; - } - if (part->bam_cache) { kfree(part->bam_cache); part->bam_cache = NULL; - } - } /* ftl_freepart */ static void ftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) diff --git a/drivers/mtd/maps/uclinux.c b/drivers/mtd/maps/uclinux.c index 811d92e5f5b..cc372136e85 100644 --- a/drivers/mtd/maps/uclinux.c +++ b/drivers/mtd/maps/uclinux.c @@ -25,9 +25,6 @@ /****************************************************************************/ - -/****************************************************************************/ - struct map_info uclinux_ram_map = { .name = "RAM", }; @@ -60,14 +57,15 @@ int __init uclinux_mtd_init(void) struct mtd_info *mtd; struct map_info *mapp; extern char _ebss; + unsigned long addr = (unsigned long) &_ebss; mapp = &uclinux_ram_map; - mapp->phys = (unsigned long) &_ebss; - mapp->size = PAGE_ALIGN(*((unsigned long *)((&_ebss) + 8))); + mapp->phys = addr; + mapp->size = PAGE_ALIGN(ntohl(*((unsigned long *)(addr + 8)))); mapp->bankwidth = 4; printk("uclinux[mtd]: RAM probe address=0x%x size=0x%x\n", - (int) mapp->map_priv_2, (int) mapp->size); + (int) mapp->phys, (int) mapp->size); mapp->virt = ioremap_nocache(mapp->phys, mapp->size); @@ -95,7 +93,6 @@ int __init uclinux_mtd_init(void) printk("uclinux[mtd]: set %s to be root filesystem\n", uclinux_romfs[0].name); ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 0); - put_mtd_device(mtd); return(0); } @@ -109,7 +106,7 @@ void __exit uclinux_mtd_cleanup(void) map_destroy(uclinux_ram_mtdinfo); uclinux_ram_mtdinfo = NULL; } - if (uclinux_ram_map.map_priv_1) { + if (uclinux_ram_map.virt) { iounmap((void *) uclinux_ram_map.virt); uclinux_ram_map.virt = 0; } |