Commit b0e54f7c authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Corbet

ip27-rtc: BKL pushdown

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 6b0ee363
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/bcd.h> #include <linux/bcd.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/smp_lock.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/ioport.h> #include <linux/ioport.h>
...@@ -163,15 +164,18 @@ static long rtc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -163,15 +164,18 @@ static long rtc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
static int rtc_open(struct inode *inode, struct file *file) static int rtc_open(struct inode *inode, struct file *file)
{ {
lock_kernel();
spin_lock_irq(&rtc_lock); spin_lock_irq(&rtc_lock);
if (rtc_status & RTC_IS_OPEN) { if (rtc_status & RTC_IS_OPEN) {
spin_unlock_irq(&rtc_lock); spin_unlock_irq(&rtc_lock);
unlock_kernel();
return -EBUSY; return -EBUSY;
} }
rtc_status |= RTC_IS_OPEN; rtc_status |= RTC_IS_OPEN;
spin_unlock_irq(&rtc_lock); spin_unlock_irq(&rtc_lock);
unlock_kernel();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment