Skip to content

Commit f5cf8f0

Browse files
David WoodhouseDavid Woodhouse
authored andcommitted
mtd: Disable mtdchar mmap on MMU systems
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>
1 parent ffe3150 commit f5cf8f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/mtd/mtdchar.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,11 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma)
11621162
resource_size_t start, off;
11631163
unsigned long len, vma_len;
11641164

1165-
if (mtd->type == MTD_RAM || mtd->type == MTD_ROM) {
1165+
/* This is broken because it assumes the MTD device is map-based
1166+
and that mtd->priv is a valid struct map_info. It should be
1167+
replaced with something that uses the mtd_get_unmapped_area()
1168+
operation properly. */
1169+
if (0 /*mtd->type == MTD_RAM || mtd->type == MTD_ROM*/) {
11661170
off = get_vm_offset(vma);
11671171
start = map->phys;
11681172
len = PAGE_ALIGN((start & ~PAGE_MASK) + map->size);

0 commit comments

Comments
 (0)