aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/genrtc.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2008-05-20 13:15:55 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:57 -0400
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 69f0a2993af0..aac0985a572b 100644
--- a/drivers/char/genrtc.c
+++ b/drivers/char/genrtc.c
@@ -51,6 +51,7 @@
51#include <linux/init.h> 51#include <linux/init.h>
52#include <linux/poll.h> 52#include <linux/poll.h>
53#include <linux/proc_fs.h> 53#include <linux/proc_fs.h>
54#include <linux/smp_lock.h>
54#include <linux/workqueue.h> 55#include <linux/workqueue.h>
55 56
56#include <asm/uaccess.h> 57#include <asm/uaccess.h>
@@ -338,12 +339,16 @@ static int gen_rtc_ioctl(struct inode *inode, struct file *file,
338 339
339static int gen_rtc_open(struct inode *inode, struct file *file) 340static int gen_rtc_open(struct inode *inode, struct file *file)
340{ 341{
341 if (gen_rtc_status & RTC_IS_OPEN) 342 lock_kernel();
343 if (gen_rtc_status & RTC_IS_OPEN) {
344 unlock_kernel();
342 return -EBUSY; 345 return -EBUSY;
346 }
343 347
344 gen_rtc_status |= RTC_IS_OPEN; 348 gen_rtc_status |= RTC_IS_OPEN;
345 gen_rtc_irq_data = 0; 349 gen_rtc_irq_data = 0;
346 irq_active = 0; 350 irq_active = 0;
351 unlock_kernel();
347 352
348 return 0; 353 return 0;
349} 354}