lkml.org 
[lkml]   [2015]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] staging: Comedi: comedi_fops: Fixed the return error code
Date
From: Santhosh Pai <santhosh.pai88@yahoo.com>

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>
---
drivers/staging/comedi/comedi_fops.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 985d94b..1ab443c 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) {
--
2.1.4


\
 
 \ /
  Last update: 2015-06-29 12:01    [W:0.038 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site