Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[linux-2.6-microblaze.git] / drivers / mtd / mtdchar.c
index 684bfa3..2147e73 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/mount.h>
 #include <linux/blkpg.h>
 #include <linux/magic.h>
+#include <linux/major.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/map.h>
@@ -1099,7 +1100,7 @@ static unsigned long mtdchar_get_unmapped_area(struct file *file,
                return (unsigned long) -EINVAL;
 
        ret = mtd_get_unmapped_area(mtd, len, offset, flags);
-       return ret == -EOPNOTSUPP ? -ENOSYS : ret;
+       return ret == -EOPNOTSUPP ? -ENODEV : ret;
 }
 #endif
 
@@ -1124,9 +1125,9 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma)
 #endif
                return vm_iomap_memory(vma, map->phys, map->size);
        }
-       return -ENOSYS;
+       return -ENODEV;
 #else
-       return vma->vm_flags & VM_SHARED ? 0 : -ENOSYS;
+       return vma->vm_flags & VM_SHARED ? 0 : -EACCES;
 #endif
 }