]> git.karo-electronics.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2013 04:27:27 +0000 (21:27 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/mtdchar.c

index a6e74514e6624e95f8e6e56fb319d567b1011f78..76afcb4fd8b43703ac0b5492fe32d0c0e2f842f3 100644 (file)
@@ -1162,7 +1162,11 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma)
        resource_size_t start, off;
        unsigned long len, vma_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 = get_vm_offset(vma);
                start = map->phys;
                len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size);