mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: julien.dehee@gmail.com
To: gregkh@linuxfoundation.org, abbotti@mev.co.uk,
	hsweeten@visionengravers.com, tapaswenipathak@gmail.com,
	hamohammed.sa@gmail.com, viro@zeniv.linux.org.uk,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Cc: Julien Dehee <julien.dehee@gmail.com>
Subject: [PATCH] staging: comedi: replace ENOSYS by proper error codes
Date: Fri, 12 Jun 2015 22:20:38 +0200	[thread overview]
Message-ID: <1434140438-57879-1-git-send-email-julien.dehee@gmail.com> (raw)

From: Julien Dehee <julien.dehee@gmail.com>

comedi/comedi_fops.c
    use ENODEV following open manual

comedi/drivers.c
    use ENOTTY following ioctl manual

drivers/serial2002.c
    use ENOTTY following ioctl manual

Signed-off-by: Julien Dehee <julien.dehee@gmail.com>
---
 drivers/staging/comedi/comedi_fops.c        | 2 +-
 drivers/staging/comedi/drivers.c            | 2 +-
 drivers/staging/comedi/drivers/serial2002.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 146ab00..6896a1f 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2611,7 +2611,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 = -ENODEV;
 			goto out;
 		}
 		if (dev->open) {
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index ed0b60c..db89096 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -820,7 +820,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			 "driver '%s' does not support attach using comedi_config\n",
 			 driv->driver_name);
 		module_put(driv->module);
-		ret = -ENOSYS;
+		ret = -ENOTTY;
 		goto out;
 	}
 	dev->driver = driv;
diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
index 83da162..929bf20 100644
--- a/drivers/staging/comedi/drivers/serial2002.c
+++ b/drivers/staging/comedi/drivers/serial2002.c
@@ -101,7 +101,7 @@ static long serial2002_tty_ioctl(struct file *f, unsigned op,
 	if (f->f_op->unlocked_ioctl)
 		return f->f_op->unlocked_ioctl(f, op, param);
 
-	return -ENOSYS;
+	return -ENOTTY;
 }
 
 static int serial2002_tty_write(struct file *f, unsigned char *buf, int count)
-- 
1.9.1


             reply	other threads:[~2015-06-12 20:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 20:20 julien.dehee [this message]
2015-06-12 20:43 ` Greg KH
2015-06-12 21:06   ` One Thousand Gnomes
2015-06-12 22:26     ` Greg KH
2015-06-12 23:46       ` Greg KH
2015-06-14 13:58 ` Ian Abbott

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=1434140438-57879-1-git-send-email-julien.dehee@gmail.com \
    --to=julien.dehee@gmail.com \
    --cc=abbotti@mev.co.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tapaswenipathak@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /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®