[MIPS] Switch from to_tm to rtc_time_to_tm

This replaces the MIPS-specific to_tm function with the generic
rtc_time_to_tm function.  The big difference between the two functions is
that rtc_time_to_tm uses epoch 70 while to_tm uses 1970, so the result of
rtc_time_to_tm needs to be fixed up.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
Ralf Baechle
2007-10-11 23:46:09 +01:00
parent 4b550488f8
commit 90b02340dc
7 changed files with 14 additions and 63 deletions

View File

@@ -29,7 +29,7 @@
#include <asm/sgi/ip22.h>
/*
* note that mktime uses month from 1 to 12 while to_tm
* Note that mktime uses month from 1 to 12 while rtc_time_to_tm
* uses 0 to 11.
*/
unsigned long read_persistent_clock(void)
@@ -66,10 +66,10 @@ int rtc_mips_set_time(unsigned long tim)
unsigned int save_control;
unsigned long flags;
to_tm(tim, &tm);
rtc_time_to_tm(tim, &tm);
tm.tm_mon += 1; /* tm_mon starts at zero */
tm.tm_year -= 1940;
tm.tm_year -= 40;
if (tm.tm_year >= 100)
tm.tm_year -= 100;