diff options
| author | Steve French <sfrench@us.ibm.com> | 2008-08-26 16:56:05 +0000 |
|---|---|---|
| committer | Steve French <sfrench@us.ibm.com> | 2008-08-26 16:56:05 +0000 |
| commit | 3dae49abef945c55c10fa7c479cfd8fd13af55db (patch) | |
| tree | 487c47c6d23cc28a259b913396aeaff0b792d32d /include/asm-generic/rtc.h | |
| parent | 6ce5eecb9cd3ac97b952c50309b87c31488a45e9 (diff) | |
| parent | b8e6c91c74e9f0279b7c51048779b3d62da60b88 (diff) | |
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'include/asm-generic/rtc.h')
| -rw-r--r-- | include/asm-generic/rtc.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h index be4af0029ac..71ef3f0b968 100644 --- a/include/asm-generic/rtc.h +++ b/include/asm-generic/rtc.h @@ -15,6 +15,7 @@ #include <linux/mc146818rtc.h> #include <linux/rtc.h> #include <linux/bcd.h> +#include <linux/delay.h> #define RTC_PIE 0x40 /* periodic interrupt enable */ #define RTC_AIE 0x20 /* alarm interrupt enable */ @@ -43,7 +44,6 @@ static inline unsigned char rtc_is_updating(void) static inline unsigned int get_rtc_time(struct rtc_time *time) { - unsigned long uip_watchdog = jiffies; unsigned char ctrl; unsigned long flags; @@ -53,19 +53,15 @@ static inline unsigned int get_rtc_time(struct rtc_time *time) /* * read RTC once any update in progress is done. The update - * can take just over 2ms. We wait 10 to 20ms. There is no need to + * can take just over 2ms. We wait 20ms. There is no need to * to poll-wait (up to 1s - eeccch) for the falling edge of RTC_UIP. * If you need to know *exactly* when a second has started, enable * periodic update complete interrupts, (via ioctl) and then * immediately read /dev/rtc which will block until you get the IRQ. * Once the read clears, read the RTC time (again via ioctl). Easy. */ - - if (rtc_is_updating() != 0) - while (jiffies - uip_watchdog < 2*HZ/100) { - barrier(); - cpu_relax(); - } + if (rtc_is_updating()) + mdelay(20); /* * Only the values that we read from the RTC are set. We leave |
