Skip to contentSkip to conversation

staging : Comedi : comedi_fops : Fixed the return error code

PATCH Ian Abbott 2 participants 2 messages Jun 22, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ian Abbott

author
#1 lore raw
Quoted 10 lines · Santosh

This patch fixes the checkpatch.pl warning:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Regards,

Santosh Pai

0001-staging-Comedi-comedi_fops-Fixed-the-return-error-co.patch

Greg doesn't usually take patches in attachments.

Quoted 18 lines

From 502464417255edb52a1db71146e2f33e67df87ce Mon Sep 17 00:00:00 2001
From: sanpai<[email protected]>
Date: Sun, 21 Jun 2015 15:05:00 +0530
Subject: [PATCH] staging : Comedi : comedi_fops : Fixed the return error code

try_module_get fails when the reference count of the module is not allowed to be incremented ,and hence -EPERM is returned.

---
  drivers/staging/comedi/comedi_fops.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/comedi/comedi_fops.c +0 -0
index 985d94b..d6a37e9 100644

drivers/staging/comedi/comedi_fops.c static int comedi_open(struct inode *inode, struct file *file) · line 2609

Quoted 5 lines
drivers/staging/comedi/comedi_fops.c +1 -1
@@ -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 = -EPERM;

Why -EPERM? I think either -ENODEV or -ENXIO would be better.

Quoted 5 lines
drivers/staging/comedi/comedi_fops.c +0 -1
  			goto out;
  		}
  		if (dev->open) {
-- 1.7.9.5
Signature · 5 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/
#2 lore raw
Quoted 5 lines · Ian Abbott
Quoted 4 lines · Santosh

This patch fixes the checkpatch.pl warning:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Quoted 18 lines
Quoted 6 lines

Regards,

Santosh Pai

0001-staging-Comedi-comedi_fops-Fixed-the-return-error-co.patch

Greg doesn't usually take patches in attachments.

Quoted 9 lines

From 502464417255edb52a1db71146e2f33e67df87ce Mon Sep 17 00:00:00 2001
From: sanpai<[email protected]>
Date: Sun, 21 Jun 2015 15:05:00 +0530
Subject: [PATCH] staging : Comedi : comedi_fops : Fixed the return error code

try_module_get fails when the reference count of the module is not allowed to be incremented ,and hence -EPERM is returned.

And your Signed-off-by name is not matching with your email From: header name. Please use your real name in both places. I don't think "sanpai" is your real name.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/