aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ds1286.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/ds1286.c')
-rw-r--r--drivers/char/ds1286.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/ds1286.c b/drivers/char/ds1286.c
index ea35ab2c9909..fb584938c9c3 100644
--- a/drivers/char/ds1286.c
+++ b/drivers/char/ds1286.c
@@ -27,6 +27,7 @@
27 * option) any later version. 27 * option) any later version.
28 */ 28 */
29#include <linux/ds1286.h> 29#include <linux/ds1286.h>
30#include <linux/smp_lock.h>
30#include <linux/types.h> 31#include <linux/types.h>
31#include <linux/errno.h> 32#include <linux/errno.h>
32#include <linux/miscdevice.h> 33#include <linux/miscdevice.h>
@@ -252,6 +253,7 @@ static int ds1286_ioctl(struct inode *inode, struct file *file,
252 253
253static int ds1286_open(struct inode *inode, struct file *file) 254static int ds1286_open(struct inode *inode, struct file *file)
254{ 255{
256 lock_kernel();
255 spin_lock_irq(&ds1286_lock); 257 spin_lock_irq(&ds1286_lock);
256 258
257 if (ds1286_status & RTC_IS_OPEN) 259 if (ds1286_status & RTC_IS_OPEN)
@@ -260,10 +262,12 @@ static int ds1286_open(struct inode *inode, struct file *file)
260 ds1286_status |= RTC_IS_OPEN; 262 ds1286_status |= RTC_IS_OPEN;
261 263
262 spin_unlock_irq(&ds1286_lock); 264 spin_unlock_irq(&ds1286_lock);
265 unlock_kernel();
263 return 0; 266 return 0;
264 267
265out_busy: 268out_busy:
266 spin_lock_irq(&ds1286_lock); 269 spin_lock_irq(&ds1286_lock);
270 unlock_kernel();
267 return -EBUSY; 271 return -EBUSY;
268} 272}
269 273