Commit 095a3cac authored by David Woodhouse's avatar David Woodhouse Committed by Ben Hutchings

mtd: Disable mtdchar mmap on MMU systems

commit f5cf8f07 upstream.

This code was broken because it assumed that all MTD devices were map-based.
Disable it for now, until it can be fixed properly for the next merge window.
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 8b060e41
...@@ -1154,7 +1154,11 @@ static int mtd_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -1154,7 +1154,11 @@ static int mtd_mmap(struct file *file, struct vm_area_struct *vma)
unsigned long off; unsigned long off;
u32 len; u32 len;
if (mtd->type == MTD_RAM || mtd->type == MTD_ROM) { /* This is broken because it assumes the MTD device is map-based
and that mtd->priv is a valid struct map_info. It should be
replaced with something that uses the mtd_get_unmapped_area()
operation properly. */
if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/) {
off = vma->vm_pgoff << PAGE_SHIFT; off = vma->vm_pgoff << PAGE_SHIFT;
start = map->phys; start = map->phys;
len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size); len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment