Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45628
b: refs/heads/master
c: 47e3774
h: refs/heads/master
v: v3
  • Loading branch information
Vijay Kumar authored and David Woodhouse committed Oct 21, 2006
1 parent bb821f4 commit 97a78f5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6652018c829c26d6ab0524c5c74f70daa5ed478d
refs/heads/master: 47e37743381823a5c2d51ef88cfc3d6cff1f8580
22 changes: 0 additions & 22 deletions trunk/drivers/mtd/nand/nandsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/delay.h>
#ifdef CONFIG_NS_ABS_POS
#include <asm/io.h>
#endif


/* Default simulator parameters values */
#if !defined(CONFIG_NANDSIM_FIRST_ID_BYTE) || \
Expand Down Expand Up @@ -440,22 +436,13 @@ init_nandsim(struct mtd_info *mtd)
printk("options: %#x\n", ns->options);

/* 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);
if (!ns->mem.byte) {
NS_ERR("init_nandsim: unable to allocate %u bytes for flash image\n",
ns->geom.totszoob);
return -ENOMEM;
}
memset(ns->mem.byte, 0xFF, ns->geom.totszoob);
#endif

/* Allocate / initialize the internal buffer */
ns->buf.byte = kmalloc(ns->geom.pgszoob, GFP_KERNEL);
Expand All @@ -474,11 +461,7 @@ init_nandsim(struct mtd_info *mtd)
return 0;

error:
#ifdef CONFIG_NS_ABS_POS
iounmap(ns->mem.byte);
#else
vfree(ns->mem.byte);
#endif

return -ENOMEM;
}
Expand All @@ -490,12 +473,7 @@ static void
free_nandsim(struct nandsim *ns)
{
kfree(ns->buf.byte);

#ifdef CONFIG_NS_ABS_POS
iounmap(ns->mem.byte);
#else
vfree(ns->mem.byte);
#endif

return;
}
Expand Down

0 comments on commit 97a78f5

Please sign in to comment.