aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ip27-rtc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/ip27-rtc.c')
-rw-r--r--drivers/char/ip27-rtc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/ip27-rtc.c b/drivers/char/ip27-rtc.c
index 86e6538a77b0..ec9d0443d92c 100644
--- a/drivers/char/ip27-rtc.c
+++ b/drivers/char/ip27-rtc.c
@@ -27,6 +27,7 @@
27#include <linux/bcd.h> 27#include <linux/bcd.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/smp_lock.h>
30#include <linux/types.h> 31#include <linux/types.h>
31#include <linux/miscdevice.h> 32#include <linux/miscdevice.h>
32#include <linux/ioport.h> 33#include <linux/ioport.h>
@@ -163,15 +164,18 @@ static long rtc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
163 164
164static int rtc_open(struct inode *inode, struct file *file) 165static int rtc_open(struct inode *inode, struct file *file)
165{ 166{
167 lock_kernel();
166 spin_lock_irq(&rtc_lock); 168 spin_lock_irq(&rtc_lock);
167 169
168 if (rtc_status & RTC_IS_OPEN) { 170 if (rtc_status & RTC_IS_OPEN) {
169 spin_unlock_irq(&rtc_lock); 171 spin_unlock_irq(&rtc_lock);
172 unlock_kernel();
170 return -EBUSY; 173 return -EBUSY;
171 } 174 }
172 175
173 rtc_status |= RTC_IS_OPEN; 176 rtc_status |= RTC_IS_OPEN;
174 spin_unlock_irq(&rtc_lock); 177 spin_unlock_irq(&rtc_lock);
178 unlock_kernel();
175 179
176 return 0; 180 return 0;
177} 181}