Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82914
b: refs/heads/master
c: 795d45b
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Ingo Molnar committed Feb 4, 2008
1 parent 45fad6e commit a7ed3f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b610eec7a06ede64f71459e7f412dfd96f4cc5e
refs/heads/master: 795d45b22c079946332bf3825afefe5a981a97b6
11 changes: 7 additions & 4 deletions trunk/include/asm-generic/rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,20 @@
static inline unsigned char rtc_is_updating(void)
{
unsigned char uip;
unsigned long flags;

spin_lock_irq(&rtc_lock);
spin_lock_irqsave(&rtc_lock, flags);
uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
spin_unlock_irq(&rtc_lock);
spin_unlock_irqrestore(&rtc_lock, flags);
return uip;
}

static inline unsigned int get_rtc_time(struct rtc_time *time)
{
unsigned long uip_watchdog = jiffies;
unsigned char ctrl;
unsigned long flags;

#ifdef CONFIG_MACH_DECSTATION
unsigned int real_year;
#endif
Expand All @@ -72,7 +75,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
* RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
* by the RTC when initially set to a non-zero value.
*/
spin_lock_irq(&rtc_lock);
spin_lock_irqsave(&rtc_lock, flags);
time->tm_sec = CMOS_READ(RTC_SECONDS);
time->tm_min = CMOS_READ(RTC_MINUTES);
time->tm_hour = CMOS_READ(RTC_HOURS);
Expand All @@ -83,7 +86,7 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
real_year = CMOS_READ(RTC_DEC_YEAR);
#endif
ctrl = CMOS_READ(RTC_CONTROL);
spin_unlock_irq(&rtc_lock);
spin_unlock_irqrestore(&rtc_lock, flags);

if (!(ctrl & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
{
Expand Down

0 comments on commit a7ed3f4

Please sign in to comment.