diff options
author | Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> | 2013-10-28 12:08:15 -0400 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2013-11-11 14:18:15 -0500 |
commit | b99959323732ed0c81da2488252f64c02ad37fbe (patch) | |
tree | 87052576102b76978079a176af3c582bff072b3d /drivers/mtd | |
parent | 80bd33acdaa21fafa8ff4391ccdf879d227111bb (diff) |
mtd: mtdchar: return expected errors on mmap() call
According both to POSIX.1-2008 and Linux Programmer's Manual mmap()
syscall shouldn't return undocumented ENOSYS, this change replaces
the errno with more appropriate ENODEV and EACCESS.
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtdchar.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 9aa0c5e49c1d..2147e733533b 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
@@ -1100,7 +1100,7 @@ static unsigned long mtdchar_get_unmapped_area(struct file *file, | |||
1100 | return (unsigned long) -EINVAL; | 1100 | return (unsigned long) -EINVAL; |
1101 | 1101 | ||
1102 | ret = mtd_get_unmapped_area(mtd, len, offset, flags); | 1102 | ret = mtd_get_unmapped_area(mtd, len, offset, flags); |
1103 | return ret == -EOPNOTSUPP ? -ENOSYS : ret; | 1103 | return ret == -EOPNOTSUPP ? -ENODEV : ret; |
1104 | } | 1104 | } |
1105 | #endif | 1105 | #endif |
1106 | 1106 | ||
@@ -1125,9 +1125,9 @@ static int mtdchar_mmap(struct file *file, struct vm_area_struct *vma) | |||
1125 | #endif | 1125 | #endif |
1126 | return vm_iomap_memory(vma, map->phys, map->size); | 1126 | return vm_iomap_memory(vma, map->phys, map->size); |
1127 | } | 1127 | } |
1128 | return -ENOSYS; | 1128 | return -ENODEV; |
1129 | #else | 1129 | #else |
1130 | return vma->vm_flags & VM_SHARED ? 0 : -ENOSYS; | 1130 | return vma->vm_flags & VM_SHARED ? 0 : -EACCES; |
1131 | #endif | 1131 | #endif |
1132 | } | 1132 | } |
1133 | 1133 | ||