summaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>2013-10-30 14:08:32 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-30 10:21:39 -0700
commit1c1365e374bfadf908eae02cded7abb9e672c9d4 (patch)
tree088b98186e167393f597de9844977955ab45488f /fs/sysfs
parent4192c74940e23da727eb02b7b4ee779dde2f670a (diff)
downloadop-kernel-dev-1c1365e374bfadf908eae02cded7abb9e672c9d4.zip
op-kernel-dev-1c1365e374bfadf908eae02cded7abb9e672c9d4.tar.gz
sysfs: return correct error code on unimplemented mmap()
Both POSIX.1-2008 and Linux Programmer's Manual have a dedicated return error code for a case, when a file doesn't support mmap(), it's ENODEV. This change replaces overloaded EINVAL with ENODEV in a situation described above for sysfs binary files. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/file.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 0d7368d4..382db3c 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -477,7 +477,6 @@ static int sysfs_bin_mmap(struct file *file, struct vm_area_struct *vma)
if (!sysfs_get_active(of->sd))
goto out_unlock;
- rc = -EINVAL;
if (!battr->mmap)
goto out_put;
OpenPOWER on IntegriCloud