From: Ian Abbott <abbotti@mev.co.uk>
To: Santhosh Pai <santhosh.pai88@yahoo.com>, sudipm.mukherjee@gmail.com
Cc: hsweeten@visionengravers.com, <abbotti@mev.co.uk>,
devel@driverdev.osuosl.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] staging: Comedi: comedi_fops: Fixed the return error code
Date: Mon, 29 Jun 2015 10:41:17 +0100 [thread overview]
Message-ID: <1435570877-27882-1-git-send-email-abbotti@mev.co.uk> (raw)
In-Reply-To: <55910FC7.1020506@mev.co.uk>
From: Santhosh Pai <santhosh.pai88@yahoo.com>
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
next prev parent reply other threads:[~2015-06-29 9:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <558E3641.1050405@yahoo.com>
2015-06-29 9:15 ` Subject: [PATCH 1/2] staging : Comedi : comedi_fops : Fixed the return error, code Ian Abbott
2015-06-29 9:28 ` Ian Abbott
2015-06-29 9:41 ` Ian Abbott [this message]
2015-06-29 9:43 ` [PATCH] staging: Comedi: comedi_fops: Fixed the return error code Ian Abbott
2015-06-29 9:44 ` Ian Abbott
[not found] <55868B64.5030004@yahoo.com>
2015-06-22 9:37 ` [PATCH] staging : Comedi : comedi_fops : " Ian Abbott
2015-06-22 11:22 ` Sudip Mukherjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1435570877-27882-1-git-send-email-abbotti@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=santhosh.pai88@yahoo.com \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®