aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-mips/rtc.h
diff options
context:
space:
mode:
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}