aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/chrp/time.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-17 23:52:38 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-17 23:52:38 -0500
commit49e16b7becd6320bde51aa238c11815708f836d9 (patch)
tree38f6159992e890abe1134cecfff36b94146b4065 /arch/powerpc/platforms/chrp/time.c
parent6146eed1e972a7de93ce2e36adc5812de81e879c (diff)
powerpc: time-of-day fixes for 32-bit CHRP systems
This makes 32-bit CHRP systems use the RTAS time-of-day routines if available. It fixes a bug in the RTAS time-of-day routines where they were storing a 64-bit timebase value in an unsigned long by making those variables u64. Also, the direct-access time-of-day routines had the wrong convention for the month and year in the struct rtc_time. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms/chrp/time.c')
-rw-r--r--arch/powerpc/platforms/chrp/time.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c
index 9e53535ddb82..737ee5d9f0aa 100644
--- a/arch/powerpc/platforms/chrp/time.c
+++ b/arch/powerpc/platforms/chrp/time.c
@@ -87,7 +87,6 @@ int chrp_set_rtc_time(struct rtc_time *tmarg)
87 87
88 chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT); 88 chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
89 89
90 tm.tm_year -= 1900;
91 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { 90 if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
92 BIN_TO_BCD(tm.tm_sec); 91 BIN_TO_BCD(tm.tm_sec);
93 BIN_TO_BCD(tm.tm_min); 92 BIN_TO_BCD(tm.tm_min);
@@ -156,7 +155,7 @@ void chrp_get_rtc_time(struct rtc_time *tm)
156 BCD_TO_BIN(mon); 155 BCD_TO_BIN(mon);
157 BCD_TO_BIN(year); 156 BCD_TO_BIN(year);
158 } 157 }
159 if ((year += 1900) < 1970) 158 if (year < 70)
160 year += 100; 159 year += 100;
161 tm->tm_sec = sec; 160 tm->tm_sec = sec;
162 tm->tm_min = min; 161 tm->tm_min = min;