Skip to content

Commit 7ccef46

Browse files
arndbJonathan Corbet
authored andcommitted
ds1286: BKL pushdown
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 514bcc6 commit 7ccef46

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎drivers/char/ds1286.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* option) any later version.
2828
*/
2929
#include <linux/ds1286.h>
30+
#include <linux/smp_lock.h>
3031
#include <linux/types.h>
3132
#include <linux/errno.h>
3233
#include <linux/miscdevice.h>
@@ -252,6 +253,7 @@ static int ds1286_ioctl(struct inode *inode, struct file *file,
252253

253254
static int ds1286_open(struct inode *inode, struct file *file)
254255
{
256+
lock_kernel();
255257
spin_lock_irq(&ds1286_lock);
256258

257259
if (ds1286_status & RTC_IS_OPEN)
@@ -260,10 +262,12 @@ static int ds1286_open(struct inode *inode, struct file *file)
260262
ds1286_status |= RTC_IS_OPEN;
261263

262264
spin_unlock_irq(&ds1286_lock);
265+
unlock_kernel();
263266
return 0;
264267

265268
out_busy:
266269
spin_lock_irq(&ds1286_lock);
270+
unlock_kernel();
267271
return -EBUSY;
268272
}
269273

0 commit comments

Comments
 (0)