[PATCH][MTD] mtdpart.c: allow other drivers to get physical address of partition
Jared Hulbert
jaredeh at gmail.com
Fri Aug 3 02:42:06 EDT 2007
> point() doesn't have to be replaced. My completely untested and
> uncompiled patch below adds another parameter to point() to return the
> physical address in. Parameter is optional and only cfi_cmdset_0001.c
> currently allows it.
Hey I just thought of a different approach. What about something like:
int mtd_insert_mem(struct mtd_info *mtd, struct vm_area_struct *vma,
unsigned long addr, unsigned long offset)
{
struct map_info *map = mtd->priv;
unsigned long pfn;
pfn = (map->phys + offset) >> PAGE_SHIFT;
return vm_insert_pfn(vma, addr, pfn);
}
This way we don't need to export the physical address and we keep the
vm calls in the driver world.
More information about the linux-mtd
mailing list