diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2005-11-02 11:02:40 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-11-07 13:05:38 -0500 |
commit | e329331aedeca0f2a7e15bd26a829ee1619c05e0 (patch) | |
tree | bce2bb4ecb6b6808e9e4ebb802808e851693fa40 /include/asm-mips/rtc.h | |
parent | 28622795972984359b74aa36f9645c7ca23e460b (diff) |
Remove mips_rtc_lock
The mips_rtc_lock is no longer needed because RTC operations should be
protected already by other mechanism. (rtc_lock, local_irq_save, etc.)
Also, locking whole rtc_get_time/rtc_set_time should be avoided while
some RTC routines might take very long time (a few seconds).
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include/asm-mips/rtc.h')
-rw-r--r-- | include/asm-mips/rtc.h | 7 |
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 | ||
32 | static DEFINE_SPINLOCK(mips_rtc_lock); | ||
33 | |||
34 | static inline unsigned int get_rtc_time(struct rtc_time *time) | 31 | static 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 | } |