aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/genrtc.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 19:15:55 +0200
committerJonathan Corbet <corbet@lwn.net>2008-06-20 14:05:57 -0600
commit742a2fe31bf311d065a2bbacc2b363103b351300 (patch)
treeecf719644106b4c47bdda2e7efa9c40e6b3710eb /drivers/char/genrtc.c
parent78abb6ac919cee123e632d833a42d0312ccb2b0d (diff)
genrtc: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/char/genrtc.c')
-rw-r--r--drivers/char/genrtc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c
index 69f0a2993af..aac0985a572 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -51,6 +51,7 @@
#include <linux/init.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
+#include <linux/smp_lock.h>
#include <linux/workqueue.h>
#include <asm/uaccess.h>
@@ -338,12 +339,16 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file,
static int gen_rtc_open(struct inode *inode, struct file *file)
{
- if (gen_rtc_status & RTC_IS_OPEN)
+ lock_kernel();
+ if (gen_rtc_status & RTC_IS_OPEN) {
+ unlock_kernel();
return -EBUSY;
+ }
gen_rtc_status |= RTC_IS_OPEN;
gen_rtc_irq_data = 0;
irq_active = 0;
+ unlock_kernel();
return 0;
}