aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-test.c
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2009-06-18 19:49:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-19 19:46:05 -0400
commite6229bec25be4ba00f31dd26e25721cc96c22262 (patch)
treea27e4c51dd8b9aaeb589a147a22bbd06bde77cf0 /drivers/rtc/rtc-test.c
parent575c5807f6842422e9fe2432fd48dfcc1d7aef41 (diff)
rtc: make rtc_update_irq callable with irqs enabled
The rtc_update_irq() might be called with irqs enabled, if a interrupt handler was registered without IRQF_DISABLED. Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_lock/spin_unlock. Also update kerneldoc and drivers which do extra work to follow the current interface spec, as suggestted by David Brownell. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-test.c')
-rw-r--r--drivers/rtc/rtc-test.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c
index e478280ff628..51725f7755b0 100644
--- a/drivers/rtc/rtc-test.c
+++ b/drivers/rtc/rtc-test.c
@@ -93,7 +93,6 @@ static ssize_t test_irq_store(struct device *dev,
93 struct rtc_device *rtc = platform_get_drvdata(plat_dev); 93 struct rtc_device *rtc = platform_get_drvdata(plat_dev);
94 94
95 retval = count; 95 retval = count;
96 local_irq_disable();
97 if (strncmp(buf, "tick", 4) == 0) 96 if (strncmp(buf, "tick", 4) == 0)
98 rtc_update_irq(rtc, 1, RTC_PF | RTC_IRQF); 97 rtc_update_irq(rtc, 1, RTC_PF | RTC_IRQF);
99 else if (strncmp(buf, "alarm", 5) == 0) 98 else if (strncmp(buf, "alarm", 5) == 0)
@@ -102,7 +101,6 @@ static ssize_t test_irq_store(struct device *dev,
102 rtc_update_irq(rtc, 1, RTC_UF | RTC_IRQF); 101 rtc_update_irq(rtc, 1, RTC_UF | RTC_IRQF);
103 else 102 else
104 retval = -EINVAL; 103 retval = -EINVAL;
105 local_irq_enable();
106 104
107 return retval; 105 return retval;
108} 106}