Commit 47e37743 authored by Vijay Kumar's avatar Vijay Kumar Committed by David Woodhouse

[MTD] NAND: nandsim page-wise allocation (1/2)

This patch removes code that does chip mapping. The chip mapping code
is no longer used.
Signed-off-by: default avatarVijay Kumar <vijaykumar@bravegnu.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent 6652018c
...@@ -37,10 +37,6 @@ ...@@ -37,10 +37,6 @@
#include <linux/mtd/nand.h> #include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h> #include <linux/mtd/partitions.h>
#include <linux/delay.h> #include <linux/delay.h>
#ifdef CONFIG_NS_ABS_POS
#include <asm/io.h>
#endif
/* Default simulator parameters values */ /* Default simulator parameters values */
#if !defined(CONFIG_NANDSIM_FIRST_ID_BYTE) || \ #if !defined(CONFIG_NANDSIM_FIRST_ID_BYTE) || \
...@@ -440,14 +436,6 @@ init_nandsim(struct mtd_info *mtd) ...@@ -440,14 +436,6 @@ init_nandsim(struct mtd_info *mtd)
printk("options: %#x\n", ns->options); printk("options: %#x\n", ns->options);
/* Map / allocate and initialize the flash image */ /* Map / allocate and initialize the flash image */
#ifdef CONFIG_NS_ABS_POS
ns->mem.byte = ioremap(CONFIG_NS_ABS_POS, ns->geom.totszoob);
if (!ns->mem.byte) {
NS_ERR("init_nandsim: failed to map the NAND flash image at address %p\n",
(void *)CONFIG_NS_ABS_POS);
return -ENOMEM;
}
#else
ns->mem.byte = vmalloc(ns->geom.totszoob); ns->mem.byte = vmalloc(ns->geom.totszoob);
if (!ns->mem.byte) { if (!ns->mem.byte) {
NS_ERR("init_nandsim: unable to allocate %u bytes for flash image\n", NS_ERR("init_nandsim: unable to allocate %u bytes for flash image\n",
...@@ -455,7 +443,6 @@ init_nandsim(struct mtd_info *mtd) ...@@ -455,7 +443,6 @@ init_nandsim(struct mtd_info *mtd)
return -ENOMEM; return -ENOMEM;
} }
memset(ns->mem.byte, 0xFF, ns->geom.totszoob); memset(ns->mem.byte, 0xFF, ns->geom.totszoob);
#endif
/* Allocate / initialize the internal buffer */ /* Allocate / initialize the internal buffer */
ns->buf.byte = kmalloc(ns->geom.pgszoob, GFP_KERNEL); ns->buf.byte = kmalloc(ns->geom.pgszoob, GFP_KERNEL);
...@@ -474,11 +461,7 @@ init_nandsim(struct mtd_info *mtd) ...@@ -474,11 +461,7 @@ init_nandsim(struct mtd_info *mtd)
return 0; return 0;
error: error:
#ifdef CONFIG_NS_ABS_POS
iounmap(ns->mem.byte);
#else
vfree(ns->mem.byte); vfree(ns->mem.byte);
#endif
return -ENOMEM; return -ENOMEM;
} }
...@@ -490,12 +473,7 @@ static void ...@@ -490,12 +473,7 @@ static void
free_nandsim(struct nandsim *ns) free_nandsim(struct nandsim *ns)
{ {
kfree(ns->buf.byte); kfree(ns->buf.byte);
#ifdef CONFIG_NS_ABS_POS
iounmap(ns->mem.byte);
#else
vfree(ns->mem.byte); vfree(ns->mem.byte);
#endif
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment