[PATCH][MTD] mtdpart.c: allow other drivers to get physical address of partition

Jared Hulbert jaredeh at gmail.com
Fri Aug 3 18:29:27 EDT 2007


On 8/3/07, Jörn Engel <joern at logfs.org> wrote:
> On Thu, 2 August 2007 23:42:06 -0700, Jared Hulbert wrote:
> >
> > > 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.
>
> Hard to tell without looking at the AXFS code as well.  And it might
> trigger some janitor to remove this "completely unused function" shortly
> after introducing it.

Of course. I don't mind tracking it out of tree for a few weeks as
long after we agree on the solution here.

> How impolite would it be to ask for AXFS again? :)

I missed the cue the first time around, sorry.  Just keep asking until
it gets through my thick head....

I'll put a clean drop together on http://axfs.sf.net



More information about the linux-mtd mailing list