]> git.baikalelectronics.ru Git - kernel.git/commit
vrtc: change its year offset from 1960 to 1972
authorFeng Tang <feng.tang@intel.com>
Thu, 10 Nov 2011 13:23:39 +0000 (13:23 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 12 Nov 2011 01:58:58 +0000 (23:58 -0200)
commita52fe450364edb27e2154e4d741f2c3300821d82
tree906c40cec199f96f657a1e782fdc4dfcfdc81ade
parentc02da6d485c48286175063ca37a3a7c9b66551bc
vrtc: change its year offset from 1960 to 1972

Real world year equals the value in vrtc YEAR register plus an offset.
We used 1960 as the offset to make leap year consistent, but for a
device's first use, its YEAR register is 0 and the system year will
be parsed as 1960 which is not a valid UNIX time and will cause many
applications to fail mysteriously. So we use 1972 instead to fix this
issue.

Updated patch which adds a sanity check suggested by Mathias

This isn't a change in behaviour for systems, because 1972 is the one we
actually use. It's the old version in upstream which is out of sync with
all devices.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/platform/mrst/vrtc.c
drivers/rtc/rtc-mrst.c