Commit 49fa3c0869677facd846adc928c332b4c20cdc25
Committed by
Ralf Baechle
1 parent
821d313c25
Exists in
master
and in
7 other branches
[MIPS] SNI: Fix mc146818_decode_year
Big endian RMs uses a different mc146818_decode_year than little endian RMs Correct mc146818_decode_year for years before 2000 Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Showing 4 changed files with 10 additions and 6 deletions Side-by-side Diff
include/asm-mips/mach-atlas/mc146818rtc.h
include/asm-mips/mach-generic/mc146818rtc.h
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | #define RTC_ALWAYS_BCD 1 |
31 | 31 | |
32 | 32 | #ifndef mc146818_decode_year |
33 | -#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1970) | |
33 | +#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) | |
34 | 34 | #endif |
35 | 35 | |
36 | 36 | #endif /* __ASM_MACH_GENERIC_MC146818RTC_H */ |
include/asm-mips/mach-mips/mc146818rtc.h
include/asm-mips/mach-rm/mc146818rtc.h
... | ... | @@ -7,12 +7,16 @@ |
7 | 7 | * |
8 | 8 | * RTC routines for PC style attached Dallas chip with ARC epoch. |
9 | 9 | */ |
10 | -#ifndef __ASM_MACH_RM200_MC146818RTC_H | |
11 | -#define __ASM_MACH_RM200_MC146818RTC_H | |
10 | +#ifndef __ASM_MACH_RM_MC146818RTC_H | |
11 | +#define __ASM_MACH_RM_MC146818RTC_H | |
12 | 12 | |
13 | +#if CONFIG_CPU_BIG_ENDIAN | |
14 | +#define mc146818_decode_year(year) ((year) < 70 ? (year) + 2000 : (year) + 1900) | |
15 | +#else | |
13 | 16 | #define mc146818_decode_year(year) ((year) + 1980) |
17 | +#endif | |
14 | 18 | |
15 | 19 | #include_next <mc146818rtc.h> |
16 | 20 | |
17 | -#endif /* __ASM_MACH_RM200_MC146818RTC_H */ | |
21 | +#endif /* __ASM_MACH_RM_MC146818RTC_H */ |