提交 7ccef463 编写于 作者: A Arnd Bergmann 提交者: Jonathan Corbet

ds1286: BKL pushdown

Signed-off-by: NArnd Bergmann <arnd@arndb.de>
上级 514bcc66
......@@ -27,6 +27,7 @@
* option) any later version.
*/
#include <linux/ds1286.h>
#include <linux/smp_lock.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/miscdevice.h>
......@@ -252,6 +253,7 @@ static int ds1286_ioctl(struct inode *inode, struct file *file,
static int ds1286_open(struct inode *inode, struct file *file)
{
lock_kernel();
spin_lock_irq(&ds1286_lock);
if (ds1286_status & RTC_IS_OPEN)
......@@ -260,10 +262,12 @@ static int ds1286_open(struct inode *inode, struct file *file)
ds1286_status |= RTC_IS_OPEN;
spin_unlock_irq(&ds1286_lock);
unlock_kernel();
return 0;
out_busy:
spin_lock_irq(&ds1286_lock);
unlock_kernel();
return -EBUSY;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册