aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/rtc.h
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-11-07 22:51:47 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-07 22:51:47 -0500
commit6b995751c2e851d2bc9c277b5884d0adb519e31d (patch)
tree7a15b41b5d8ce612915584a0773c670d5c0ab5b8 /include/asm-mips/rtc.h
parent6c2f4267833f453156f8f439cc32eb4c92f357b4 (diff)
parentd27ba47e7e8c466c18983a1779d611f82d6a354f (diff)
Merge branch 'master'
Diffstat (limited to 'include/asm-mips/rtc.h')
-rw-r--r--include/asm-mips/rtc.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/include/asm-mips/rtc.h b/include/asm-mips/rtc.h
index a60e0dc7c9b9..a2abc4572b63 100644
--- a/include/asm-mips/rtc.h
+++ b/include/asm-mips/rtc.h
@@ -14,7 +14,6 @@
14 14
15#ifdef __KERNEL__ 15#ifdef __KERNEL__
16 16
17#include <linux/spinlock.h>
18#include <linux/rtc.h> 17#include <linux/rtc.h>
19#include <asm/time.h> 18#include <asm/time.h>
20 19
@@ -29,17 +28,13 @@
29#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */ 28#define RTC_24H 0x02 /* 24 hour mode - else hours bit 7 means pm */
30#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */ 29#define RTC_DST_EN 0x01 /* auto switch DST - works f. USA only */
31 30
32static DEFINE_SPINLOCK(mips_rtc_lock);
33
34static inline unsigned int get_rtc_time(struct rtc_time *time) 31static inline unsigned int get_rtc_time(struct rtc_time *time)
35{ 32{
36 unsigned long nowtime; 33 unsigned long nowtime;
37 34
38 spin_lock(&mips_rtc_lock);
39 nowtime = rtc_get_time(); 35 nowtime = rtc_get_time();
40 to_tm(nowtime, time); 36 to_tm(nowtime, time);
41 time->tm_year -= 1900; 37 time->tm_year -= 1900;
42 spin_unlock(&mips_rtc_lock);
43 38
44 return RTC_24H; 39 return RTC_24H;
45} 40}
@@ -49,12 +44,10 @@ static inline int set_rtc_time(struct rtc_time *time)
49 unsigned long nowtime; 44 unsigned long nowtime;
50 int ret; 45 int ret;
51 46
52 spin_lock(&mips_rtc_lock);
53 nowtime = mktime(time->tm_year+1900, time->tm_mon+1, 47 nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
54 time->tm_mday, time->tm_hour, time->tm_min, 48 time->tm_mday, time->tm_hour, time->tm_min,
55 time->tm_sec); 49 time->tm_sec);
56 ret = rtc_set_time(nowtime); 50 ret = rtc_set_time(nowtime);
57 spin_unlock(&mips_rtc_lock);
58 51
59 return ret; 52 return ret;
60} 53}