summaryrefslogtreecommitdiffstats
path: root/arch/mips/momentum/ocelot_c/setup.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 11:15:23 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 11:15:23 -0800
commit3f00d3e8fb963968a922d821a9a53b503b687e81 (patch)
treedfac1c73ae63f8d48340f3bbb77ee53b322c59e9 /arch/mips/momentum/ocelot_c/setup.c
parent407cf84f956ee4b52da5508d5357b8ae212ff77c (diff)
parenta637a114f36b94a1ad8b9867f43bac0414958420 (diff)
downloadtalos-obmc-linux-3f00d3e8fb963968a922d821a9a53b503b687e81.tar.gz
talos-obmc-linux-3f00d3e8fb963968a922d821a9a53b503b687e81.zip
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
Diffstat (limited to 'arch/mips/momentum/ocelot_c/setup.c')
-rw-r--r--arch/mips/momentum/ocelot_c/setup.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/mips/momentum/ocelot_c/setup.c b/arch/mips/momentum/ocelot_c/setup.c
index ce70fc96f160..2755c1547473 100644
--- a/arch/mips/momentum/ocelot_c/setup.c
+++ b/arch/mips/momentum/ocelot_c/setup.c
@@ -140,7 +140,9 @@ unsigned long m48t37y_get_time(void)
unsigned char* rtc_base = (unsigned char*)0xfc800000;
#endif
unsigned int year, month, day, hour, min, sec;
+ unsigned long flags;
+ spin_lock_irqsave(&rtc_lock, flags);
/* stop the update */
rtc_base[0x7ff8] = 0x40;
@@ -157,6 +159,7 @@ unsigned long m48t37y_get_time(void)
/* start the update */
rtc_base[0x7ff8] = 0x00;
+ spin_unlock_irqrestore(&rtc_lock, flags);
return mktime(year, month, day, hour, min, sec);
}
@@ -169,11 +172,13 @@ int m48t37y_set_time(unsigned long sec)
unsigned char* rtc_base = (unsigned char*)0xfc800000;
#endif
struct rtc_time tm;
+ unsigned long flags;
/* convert to a more useful format -- note months count from 0 */
to_tm(sec, &tm);
tm.tm_mon += 1;
+ spin_lock_irqsave(&rtc_lock, flags);
/* enable writing */
rtc_base[0x7ff8] = 0x80;
@@ -197,6 +202,7 @@ int m48t37y_set_time(unsigned long sec)
/* disable writing */
rtc_base[0x7ff8] = 0x00;
+ spin_unlock_irqrestore(&rtc_lock, flags);
return 0;
}
OpenPOWER on IntegriCloud