aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ip27-rtc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-07-18 05:39:39 -0400
committerDavid S. Miller <davem@davemloft.net>2008-07-18 05:39:39 -0400
commit49997d75152b3d23c53b0fa730599f2f74c92c65 (patch)
tree46e93126170d02cfec9505172e545732c1b69656 /drivers/char/ip27-rtc.c
parenta0c80b80e0fb48129e4e9d6a9ede914f9ff1850d (diff)
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: Documentation/powerpc/booting-without-of.txt drivers/atm/Makefile drivers/net/fs_enet/fs_enet-main.c drivers/pci/pci-acpi.c net/8021q/vlan.c net/iucv/iucv.c
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}