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>
This commit is contained in:
@@ -87,7 +87,6 @@ int chrp_set_rtc_time(struct rtc_time *tmarg)
|
||||
|
||||
chrp_cmos_clock_write((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
|
||||
|
||||
tm.tm_year -= 1900;
|
||||
if (!(save_control & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {
|
||||
BIN_TO_BCD(tm.tm_sec);
|
||||
BIN_TO_BCD(tm.tm_min);
|
||||
@@ -156,7 +155,7 @@ void chrp_get_rtc_time(struct rtc_time *tm)
|
||||
BCD_TO_BIN(mon);
|
||||
BCD_TO_BIN(year);
|
||||
}
|
||||
if ((year += 1900) < 1970)
|
||||
if (year < 70)
|
||||
year += 100;
|
||||
tm->tm_sec = sec;
|
||||
tm->tm_min = min;
|
||||
|
Reference in New Issue
Block a user