diff options
-rw-r--r-- | arch/m68k/mvme16x/rtc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index e341387..432a9f1 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c @@ -10,6 +10,7 @@ #include <linux/errno.h> #include <linux/miscdevice.h> #include <linux/slab.h> +#include <linux/smp_lock.h> #include <linux/ioport.h> #include <linux/capability.h> #include <linux/fcntl.h> @@ -127,11 +128,14 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, static int rtc_open(struct inode *inode, struct file *file) { + lock_kernel(); if( !atomic_dec_and_test(&rtc_ready) ) { atomic_inc( &rtc_ready ); + unlock_kernel(); return -EBUSY; } + unlock_kernel(); return 0; } |