Commit 90e6f51d authored by Santhosh Pai's avatar Santhosh Pai Committed by Greg Kroah-Hartman
Browse files

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: default avatarsanthosh pai <santhosh.pai88@yahoo.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0e0d311e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {