Skip to content

Commit

Permalink
genrtc: BKL pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jun 20, 2008
1 parent 78abb6a commit 742a2fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/char/genrtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 742a2fe

Please sign in to comment.