From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: linux-kernel@vger.kernel.org, mingo@redhat.com
Subject: [PATCH] hpet: push BKL down into hpet driver
Date: Thu, 22 May 2008 21:39:33 +0100 [thread overview]
Message-ID: <20080522213933.3639eac4@core> (raw)
Signed-off-by: Alan Cox <alan@redhat.com>
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index e7fb0bc..054060f 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -30,6 +30,7 @@
#include <linux/seq_file.h>
#include <linux/bitops.h>
#include <linux/clocksource.h>
+#include <linux/smp_lock.h>
#include <asm/current.h>
#include <asm/uaccess.h>
@@ -371,16 +372,19 @@ static int hpet_release(struct inode *inode, struct file *file)
return 0;
}
-static int hpet_ioctl_common(struct hpet_dev *, int, unsigned long, int);
+static long hpet_ioctl_common(struct hpet_dev *, int, unsigned long, int);
-static int
-hpet_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
- unsigned long arg)
+static long hpet_ioctl(struct file *file, unsigned int cmd,
+ unsigned long arg)
{
- struct hpet_dev *devp;
+ struct hpet_dev *devp = file->private_data;
+ long ret;
- devp = file->private_data;
- return hpet_ioctl_common(devp, cmd, arg, 0);
+ lock_kernel();
+ ret = hpet_ioctl_common(devp, cmd, arg, 0);
+ unlock_kernel();
+
+ return ret;
}
static int hpet_ioctl_ieon(struct hpet_dev *devp)
@@ -476,8 +480,8 @@ static inline unsigned long hpet_time_div(struct hpets *hpets,
return (unsigned long)m;
}
-static int
-hpet_ioctl_common(struct hpet_dev *devp, int cmd, unsigned long arg, int kernel)
+static long hpet_ioctl_common(struct hpet_dev *devp, int cmd,
+ unsigned long arg, int kernel)
{
struct hpet_timer __iomem *timer;
struct hpet __iomem *hpet;
@@ -582,7 +586,7 @@ static const struct file_operations hpet_fops = {
.llseek = no_llseek,
.read = hpet_read,
.poll = hpet_poll,
- .ioctl = hpet_ioctl,
+ .unlocked_ioctl = hpet_ioctl,
.open = hpet_open,
.release = hpet_release,
.fasync = hpet_fasync,
next reply other threads:[~2008-05-22 20:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-22 20:39 Alan Cox [this message]
2008-05-27 15:37 ` [PATCH] hpet: push BKL down into hpet driver Thomas Gleixner
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=20080522213933.3639eac4@core \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.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