aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rtc/rtc-parisc.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/rtc/rtc-parisc.c b/drivers/rtc/rtc-parisc.c
index 319bb5d445ea..cb087ad407f6 100644
--- a/drivers/rtc/rtc-parisc.c
+++ b/drivers/rtc/rtc-parisc.c
@@ -14,17 +14,13 @@
14/* as simple as can be, and no simpler. */ 14/* as simple as can be, and no simpler. */
15struct parisc_rtc { 15struct parisc_rtc {
16 struct rtc_device *rtc; 16 struct rtc_device *rtc;
17 spinlock_t lock;
18}; 17};
19 18
20static int parisc_get_time(struct device *dev, struct rtc_time *tm) 19static int parisc_get_time(struct device *dev, struct rtc_time *tm)
21{ 20{
22 struct parisc_rtc *p = dev_get_drvdata(dev); 21 unsigned long ret;
23 unsigned long flags, ret;
24 22
25 spin_lock_irqsave(&p->lock, flags);
26 ret = get_rtc_time(tm); 23 ret = get_rtc_time(tm);
27 spin_unlock_irqrestore(&p->lock, flags);
28 24
29 if (ret & RTC_BATT_BAD) 25 if (ret & RTC_BATT_BAD)
30 return -EOPNOTSUPP; 26 return -EOPNOTSUPP;
@@ -34,13 +30,9 @@ static int parisc_get_time(struct device *dev, struct rtc_time *tm)
34 30
35static int parisc_set_time(struct device *dev, struct rtc_time *tm) 31static int parisc_set_time(struct device *dev, struct rtc_time *tm)
36{ 32{
37 struct parisc_rtc *p = dev_get_drvdata(dev);
38 unsigned long flags;
39 int ret; 33 int ret;
40 34
41 spin_lock_irqsave(&p->lock, flags);
42 ret = set_rtc_time(tm); 35 ret = set_rtc_time(tm);
43 spin_unlock_irqrestore(&p->lock, flags);
44 36
45 if (ret < 0) 37 if (ret < 0)
46 return -EOPNOTSUPP; 38 return -EOPNOTSUPP;
@@ -61,8 +53,6 @@ static int __devinit parisc_rtc_probe(struct platform_device *dev)
61 if (!p) 53 if (!p)
62 return -ENOMEM; 54 return -ENOMEM;
63 55
64 spin_lock_init(&p->lock);
65
66 p->rtc = rtc_device_register("rtc-parisc", &dev->dev, &parisc_rtc_ops, 56 p->rtc = rtc_device_register("rtc-parisc", &dev->dev, &parisc_rtc_ops,
67 THIS_MODULE); 57 THIS_MODULE);
68 if (IS_ERR(p->rtc)) { 58 if (IS_ERR(p->rtc)) {