[MTD][NOR] Add physical address to point() method
Adding the ability to get a physical address from point() in addition to virtual address. This physical address is required for XIP of userspace code from flash. Signed-off-by: Jared Hulbert <jaredeh@gmail.com> Reviewed-by: Jörn Engel <joern@logfs.org> Acked-by: Nicolas Pitre <nico@cam.org> Acked-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
This commit is contained in:
committed by
David Woodhouse
parent
27c72b040c
commit
a98889f3d8
@@ -97,11 +97,12 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
||||
size_t pointlen;
|
||||
|
||||
if (c->mtd->point) {
|
||||
ret = c->mtd->point (c->mtd, 0, c->mtd->size, &pointlen, &flashbuf);
|
||||
ret = c->mtd->point(c->mtd, 0, c->mtd->size, &pointlen,
|
||||
(void **)&flashbuf, NULL);
|
||||
if (!ret && pointlen < c->mtd->size) {
|
||||
/* Don't muck about if it won't let us point to the whole flash */
|
||||
D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", pointlen));
|
||||
c->mtd->unpoint(c->mtd, flashbuf, 0, pointlen);
|
||||
c->mtd->unpoint(c->mtd, 0, pointlen);
|
||||
flashbuf = NULL;
|
||||
}
|
||||
if (ret)
|
||||
@@ -267,7 +268,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
|
||||
kfree(flashbuf);
|
||||
#ifndef __ECOS
|
||||
else
|
||||
c->mtd->unpoint(c->mtd, flashbuf, 0, c->mtd->size);
|
||||
c->mtd->unpoint(c->mtd, 0, c->mtd->size);
|
||||
#endif
|
||||
if (s)
|
||||
kfree(s);
|
||||
|
Reference in New Issue
Block a user