]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: Disable mtdchar mmap on MMU systems
authorDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 9 Oct 2012 14:08:10 +0000 (15:08 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 25 Apr 2013 19:25:48 +0000 (20:25 +0100)
commit f5cf8f07423b2677cebebcebc863af77223a4972 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: David Woodhouse <David.Woodhouse@intel.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/mtd/mtdchar.c

index e7dc732ddabc6588226211b8fc23e2799e37d628..1d90e26bfa0ff252f502f2ddf3c0de6d1d7e7c17 100644 (file)
@@ -1154,7 +1154,11 @@ static int mtd_mmap(struct file *file, struct vm_area_struct *vma)
        unsigned long off;
        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;
                start = map->phys;
                len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size);