diff options
author | Philippe De Muyter <phdm@macqel.be> | 2010-08-06 11:47:13 -0400 |
---|---|---|
committer | Greg Ungerer <gerg@uclinux.org> | 2010-10-20 20:17:29 -0400 |
commit | 47422259b44e53e670b4ee375ff98f0603e6dd45 (patch) | |
tree | 00739e3461111687dcb48d1a64fa10ce0e09ba26 /arch/m68knommu | |
parent | 713e919e09492342eb8cd56f5aa7e3b33f672968 (diff) |
m68knommu: fix default starting date
Currently m68knommu boards without RTC chip start with an unexpected
default date of 1999-11-30 (Actually the source asks for 2000-00-00)
Make that 1970-01-01 instead, as expected.
Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r-- | arch/m68knommu/kernel/time.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c index a90acf5b0cde..810649341e3e 100644 --- a/arch/m68knommu/kernel/time.c +++ b/arch/m68knommu/kernel/time.c | |||
@@ -61,13 +61,16 @@ static unsigned long read_rtc_mmss(void) | |||
61 | { | 61 | { |
62 | unsigned int year, mon, day, hour, min, sec; | 62 | unsigned int year, mon, day, hour, min, sec; |
63 | 63 | ||
64 | if (mach_gettod) | 64 | if (mach_gettod) { |
65 | mach_gettod(&year, &mon, &day, &hour, &min, &sec); | 65 | mach_gettod(&year, &mon, &day, &hour, &min, &sec); |
66 | else | 66 | if ((year += 1900) < 1970) |
67 | year = mon = day = hour = min = sec = 0; | 67 | year += 100; |
68 | } else { | ||
69 | year = 1970; | ||
70 | mon = day = 1; | ||
71 | hour = min = sec = 0; | ||
72 | } | ||
68 | 73 | ||
69 | if ((year += 1900) < 1970) | ||
70 | year += 100; | ||
71 | 74 | ||
72 | return mktime(year, mon, day, hour, min, sec); | 75 | return mktime(year, mon, day, hour, min, sec); |
73 | } | 76 | } |