diff options
author | Santhosh Pai | 2015-06-29 11:44:03 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2015-07-15 03:22:20 +0200 |
commit | 90e6f51da718fc982eafd3dd7d6c78b378f67136 (patch) | |
tree | ef3eb2bf4cccfa1835f0ef6a43422bcde8238d99 /drivers/staging/comedi/comedi_fops.c | |
parent | staging: comedi: use CAP_SYS_ADMIN instead of CAP_NET_ADMIN (diff) | |
download | kernel-qcow2-linux-90e6f51da718fc982eafd3dd7d6c78b378f67136.tar.gz kernel-qcow2-linux-90e6f51da718fc982eafd3dd7d6c78b378f67136.tar.xz kernel-qcow2-linux-90e6f51da718fc982eafd3dd7d6c78b378f67136.zip |
staging: Comedi: comedi_fops: Fixed the return error code
This patch fixes the checkpatch.pl warning:
WARNING: ENOSYS means 'invalid syscall nr' and nothing else
try_module_get fails when the reference count of the module is not
allowed to be incremented ,and hence -ENXIO is returned indicating
no device or address.
[IA - combined two of santhosh's changes to the error return value!]
Signed-off-by: santhosh pai <santhosh.pai88@yahoo.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedi_fops.c')
-rw-r--r-- | drivers/staging/comedi/comedi_fops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 1679bfba25a9..4820ab6d0aa8 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2606,7 +2606,7 @@ static int comedi_open(struct inode *inode, struct file *file) } if (dev->attached && dev->use_count == 0) { if (!try_module_get(dev->driver->module)) { - rc = -ENOSYS; + rc = -ENXIO; goto out; } if (dev->open) { |