Skip to contentSkip to conversation

MTD: add physical address to point() api -- uclinux map fix

PATCH In review Jared Hulbert 1 participant 1 message Nov 8, 2007 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 8/8 MTD: add physical address to point() api -- uclinux map fix

dding 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/maps/uclinux.c +4 -2
index 14ffb1a..c42f4b8 100644
@@ -40,10 +40,12 @@ struct mtd_partition uclinux_romfs[] = {
 /****************************************************************************/
 
 int uclinux_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)
 {
 	struct map_info *map = mtd->priv;
-	*mtdbuf = (u_char *) (map->virt + ((int) from));
+	*virt = map->virt + from;
+	if (phys)
+		*phys = map->phys + from;
 	*retlen = len;
 	return(0);
 }