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>
This commit is contained in:
Vladimir Zapolskiy 2013-10-30 14:08:32 +02:00 коммит произвёл Greg Kroah-Hartman
Родитель 4192c74940
Коммит 1c1365e374
1 изменённых файлов: 0 добавлений и 1 удалений

Просмотреть файл

@ -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;