From 47422259b44e53e670b4ee375ff98f0603e6dd45 Mon Sep 17 00:00:00 2001 From: Philippe De Muyter Date: Fri, 6 Aug 2010 17:47:13 +0200 Subject: 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 Signed-off-by: Greg Ungerer --- arch/m68knommu/kernel/time.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'arch') diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c index a90acf5b0cd..810649341e3 100644 --- a/arch/m68knommu/kernel/time.c +++ b/arch/m68knommu/kernel/time.c @@ -61,13 +61,16 @@ static unsigned long read_rtc_mmss(void) { unsigned int year, mon, day, hour, min, sec; - if (mach_gettod) + if (mach_gettod) { mach_gettod(&year, &mon, &day, &hour, &min, &sec); - else - year = mon = day = hour = min = sec = 0; + if ((year += 1900) < 1970) + year += 100; + } else { + year = 1970; + mon = day = 1; + hour = min = sec = 0; + } - if ((year += 1900) < 1970) - year += 100; return mktime(year, mon, day, hour, min, sec); } -- cgit v1.2.3-70-g09d2