public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: stoyboyker@gmail.com
To: linux-kernel@vger.kernel.org
Cc: Stoyan Gaydarov <stoyboyker@gmail.com>, hdegoede@redhat.com
Subject: [PATCH 11/13] [hwmon] changed ioctls to unlocked
Date: Tue, 24 Mar 2009 16:12:46 -0500	[thread overview]
Message-ID: <1237929168-15341-12-git-send-email-stoyboyker@gmail.com> (raw)

From: Stoyan Gaydarov <stoyboyker@gmail.com>

Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com>
---
 drivers/hwmon/fschmd.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index d07f4ef..79efb7b 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -40,6 +40,7 @@
 #include <linux/hwmon-sysfs.h>
 #include <linux/err.h>
 #include <linux/mutex.h>
+#include <linux/smp_lock.h>
 #include <linux/sysfs.h>
 #include <linux/dmi.h>
 #include <linux/fs.h>
@@ -769,15 +770,17 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf,
 	return count;
 }
 
-static int watchdog_ioctl(struct inode *inode, struct file *filp,
-	unsigned int cmd, unsigned long arg)
+static long watchdog_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
 {
 	static struct watchdog_info ident = {
 		.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
 				WDIOF_CARDRESET,
 		.identity = "FSC watchdog"
 	};
-	int i, ret = 0;
+
+	lock_kernel();
+
+	int i, ret;
 	struct fschmd_data *data = filp->private_data;
 
 	switch (cmd) {
@@ -837,6 +840,10 @@ static int watchdog_ioctl(struct inode *inode, struct file *filp,
 		ret = -ENOTTY;
 	}
 
+	if(!ret)
+		ret = -ENOTTY;
+
+	unlock_kernel();
 	return ret;
 }
 
@@ -846,7 +853,7 @@ static struct file_operations watchdog_fops = {
 	.open = watchdog_open,
 	.release = watchdog_release,
 	.write = watchdog_write,
-	.ioctl = watchdog_ioctl,
+	.unlocked_ioctl = watchdog_ioctl,
 };
 
 
-- 
1.6.2


             reply	other threads:[~2009-03-24 21:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24 21:12 stoyboyker [this message]
2009-03-25  9:29 ` [PATCH 11/13] [hwmon] changed ioctls to unlocked Hans de Goede

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=1237929168-15341-12-git-send-email-stoyboyker@gmail.com \
    --to=stoyboyker@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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