aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/rtc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/rtc.h')
-rw-r--r--include/asm-generic/rtc.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h
index d3238f1f70a6..dd1bed860e64 100644
--- a/include/asm-generic/rtc.h
+++ b/include/asm-generic/rtc.h
@@ -35,10 +35,11 @@
35static inline unsigned char rtc_is_updating(void) 35static inline unsigned char rtc_is_updating(void)
36{ 36{
37 unsigned char uip; 37 unsigned char uip;
38 unsigned long flags;
38 39
39 spin_lock_irq(&rtc_lock); 40 spin_lock_irqsave(&rtc_lock, flags);
40 uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP); 41 uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
41 spin_unlock_irq(&rtc_lock); 42 spin_unlock_irqrestore(&rtc_lock, flags);
42 return uip; 43 return uip;
43} 44}
44 45
@@ -46,6 +47,8 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
46{ 47{
47 unsigned long uip_watchdog = jiffies; 48 unsigned long uip_watchdog = jiffies;
48 unsigned char ctrl; 49 unsigned char ctrl;
50 unsigned long flags;
51
49#ifdef CONFIG_MACH_DECSTATION 52#ifdef CONFIG_MACH_DECSTATION
50 unsigned int real_year; 53 unsigned int real_year;
51#endif 54#endif
@@ -72,7 +75,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
72 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated 75 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
73 * by the RTC when initially set to a non-zero value. 76 * by the RTC when initially set to a non-zero value.
74 */ 77 */
75 spin_lock_irq(&rtc_lock); 78 spin_lock_irqsave(&rtc_lock, flags);
76 time->tm_sec = CMOS_READ(RTC_SECONDS); 79 time->tm_sec = CMOS_READ(RTC_SECONDS);
77 time->tm_min = CMOS_READ(RTC_MINUTES); 80 time->tm_min = CMOS_READ(RTC_MINUTES);
78 time->tm_hour = CMOS_READ(RTC_HOURS); 81 time->tm_hour = CMOS_READ(RTC_HOURS);
@@ -83,7 +86,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
83 real_year = CMOS_READ(RTC_DEC_YEAR); 86 real_year = CMOS_READ(RTC_DEC_YEAR);
84#endif 87#endif
85 ctrl = CMOS_READ(RTC_CONTROL); 88 ctrl = CMOS_READ(RTC_CONTROL);
86 spin_unlock_irq(&rtc_lock); 89 spin_unlock_irqrestore(&rtc_lock, flags);
87 90
88 if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD) 91 if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
89 { 92 {