diff options
author | John Stultz <johnstul@us.ibm.com> | 2010-03-03 22:57:28 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-03-12 19:14:13 -0500 |
commit | 8eff8a5c1d3a1de7a2d173e0effc6cc9bcbb5177 (patch) | |
tree | 3dddecd637815a6cd26e717e6af4ce9373086e14 /arch/cris/kernel | |
parent | ffbcad49e79cd82428010b44a87401446ea7f370 (diff) |
cris: Convert cris to use read/update_persistent_clock
This patch converts the cris architecture to use the generic
read_persistent_clock and update_persistent_clock interfaces, reducing
the amount of arch specific code we have to maintain, and allowing for
further cleanups in the future.
I have not built or tested this patch, so help from arch maintainers
would be appreciated.
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
LKML-Reference: <1267675049-12337-14-git-send-email-johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/cris/kernel')
-rw-r--r-- | arch/cris/kernel/time.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/cris/kernel/time.c b/arch/cris/kernel/time.c index a05dd31f3efb..c72730d20ef6 100644 --- a/arch/cris/kernel/time.c +++ b/arch/cris/kernel/time.c | |||
@@ -98,6 +98,8 @@ unsigned long | |||
98 | get_cmos_time(void) | 98 | get_cmos_time(void) |
99 | { | 99 | { |
100 | unsigned int year, mon, day, hour, min, sec; | 100 | unsigned int year, mon, day, hour, min, sec; |
101 | if(!have_rtc) | ||
102 | return 0; | ||
101 | 103 | ||
102 | sec = CMOS_READ(RTC_SECONDS); | 104 | sec = CMOS_READ(RTC_SECONDS); |
103 | min = CMOS_READ(RTC_MINUTES); | 105 | min = CMOS_READ(RTC_MINUTES); |
@@ -119,19 +121,19 @@ get_cmos_time(void) | |||
119 | return mktime(year, mon, day, hour, min, sec); | 121 | return mktime(year, mon, day, hour, min, sec); |
120 | } | 122 | } |
121 | 123 | ||
122 | /* update xtime from the CMOS settings. used when /dev/rtc gets a SET_TIME. | ||
123 | * TODO: this doesn't reset the fancy NTP phase stuff as do_settimeofday does. | ||
124 | */ | ||
125 | 124 | ||
126 | void | 125 | int update_persistent_clock(struct timespec now) |
127 | update_xtime_from_cmos(void) | ||
128 | { | 126 | { |
129 | if(have_rtc) { | 127 | return set_rtc_mmss(now.tv_sec); |
130 | xtime.tv_sec = get_cmos_time(); | ||
131 | xtime.tv_nsec = 0; | ||
132 | } | ||
133 | } | 128 | } |
134 | 129 | ||
130 | void read_persistent_clock(struct timespec *ts) | ||
131 | { | ||
132 | ts->tv_sec = get_cmos_time(); | ||
133 | ts->tv_nsec = 0; | ||
134 | } | ||
135 | |||
136 | |||
135 | extern void cris_profile_sample(struct pt_regs* regs); | 137 | extern void cris_profile_sample(struct pt_regs* regs); |
136 | 138 | ||
137 | void | 139 | void |