summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2008-10-15 22:04:17 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-16 11:21:47 -0700
commitd05abab9a47d3245664eee413769af2e1e4b1faf (patch)
tree85f2e23054300fc6b661e8522ab3b4e6a1fc036f
parent4cea5ceb4c692ff42a2848f1b559977caff3c64e (diff)
downloadop-kernel-dev-d05abab9a47d3245664eee413769af2e1e4b1faf.zip
op-kernel-dev-d05abab9a47d3245664eee413769af2e1e4b1faf.tar.gz
Char: ds1286, eliminate busy waiting
ds1286_get_time(); is not called from atomic context, sleep for 20 ms is better choice than a (home-made) busy waiting for such a situation. Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/char/ds1286.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/char/ds1286.c b/drivers/char/ds1286.c
index fb584938..5329d48 100644
--- a/drivers/char/ds1286.c
+++ b/drivers/char/ds1286.c
@@ -443,7 +443,6 @@ static void ds1286_get_time(struct rtc_time *rtc_tm)
{
unsigned char save_control;
unsigned long flags;
- unsigned long uip_watchdog = jiffies;
/*
* read RTC once any update in progress is done. The update
@@ -456,8 +455,7 @@ static void ds1286_get_time(struct rtc_time *rtc_tm)
*/
if (ds1286_is_updating() != 0)
- while (time_before(jiffies, uip_watchdog + 2*HZ/100))
- barrier();
+ msleep(20);
/*
* Only the values that we read from the RTC are set. We leave
OpenPOWER on IntegriCloud