Skip to contentSkip to conversation

MTD: add physical address to point() api -- MTD physical RAM fixes

PATCH In review Jared Hulbert 1 participant 1 message Nov 8, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/8 MTD: add physical address to point() api -- MTD physical RAM fixes

Adding the ability to get a physical address from point() in addition to virtual address. This physical address will be required for axfs and cramfs with XIP.

----

drivers/mtd/devices/phram.c +0 -0
index 56cc1ca..06d1052 100644
@@ -57,20 +57,21 @@ static int phram_erase(struct mtd_info *mtd,

struct erase_info *instr)
}

static int phram_point(struct mtd_info *mtd, loff_t from, size_t len,
- size_t *retlen, u_char **mtdbuf)
+ size_t *retlen, void **virt, resource_size_t *phys)
{
- u_char *start = mtd->priv;
-
if (from + len > mtd->size)
return -EINVAL;

- *mtdbuf = start + from;
+ /* can we return a physical address with this driver? */
+ if (phys)
+ return -EINVAL;
+
+ *virt = mtd->priv + from;
*retlen = len;
return 0;
}

-static void phram_unpoint(struct mtd_info *mtd, u_char *addr, loff_t from,
- size_t len)
+static void phram_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
{
}