aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-dev.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-15 17:12:58 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-15 17:12:58 -0400
commit1e09481365ce248dbb4eb06dad70129bb5807037 (patch)
treec0cff5bef95c8b5e7486f144718ade9a06c284dc /drivers/rtc/rtc-dev.c
parent3e2f69fdd1b00166e7d589bce56b2d36a9e74374 (diff)
parentb9d2252c1e44fa83a4e65fdc9eb93db6297c55af (diff)
Merge branch 'linus' into core/softlockup
Conflicts: kernel/softlockup.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r--drivers/rtc/rtc-dev.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 90dfa0df747a..0114a78b7cbb 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/rtc.h> 15#include <linux/rtc.h>
16#include <linux/smp_lock.h>
16#include "rtc-core.h" 17#include "rtc-core.h"
17 18
18static dev_t rtc_devt; 19static dev_t rtc_devt;
@@ -26,8 +27,11 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
26 struct rtc_device, char_dev); 27 struct rtc_device, char_dev);
27 const struct rtc_class_ops *ops = rtc->ops; 28 const struct rtc_class_ops *ops = rtc->ops;
28 29
29 if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags)) 30 lock_kernel();
30 return -EBUSY; 31 if (test_and_set_bit_lock(RTC_DEV_BUSY, &rtc->flags)) {
32 err = -EBUSY;
33 goto out;
34 }
31 35
32 file->private_data = rtc; 36 file->private_data = rtc;
33 37
@@ -37,11 +41,13 @@ static int rtc_dev_open(struct inode *inode, struct file *file)
37 rtc->irq_data = 0; 41 rtc->irq_data = 0;
38 spin_unlock_irq(&rtc->irq_lock); 42 spin_unlock_irq(&rtc->irq_lock);
39 43
40 return 0; 44 goto out;
41 } 45 }
42 46
43 /* something has gone wrong */ 47 /* something has gone wrong */
44 clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags); 48 clear_bit_unlock(RTC_DEV_BUSY, &rtc->flags);
49out:
50 unlock_kernel();
45 return err; 51 return err;
46} 52}
47 53