drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time
authorTony Prisk <linux@prisktech.co.nz>
Fri, 4 Jan 2013 23:35:48 +0000 (15:35 -0800)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 16 Jan 2013 01:13:21 +0000 (01:13 +0000)
commit75814f2829338a36860476da7f9e07176e35e081
tree9dc28a5c8f4ca82f82ac4262e55c2927aae68357
parentc71f617db16d23d9c01faf7e5f63c058047d9648
drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time

commit 2f90b68309683f2c5765a1b04ca23d71e51f1494 upstream.

tm_mon is 0..11, whereas vt8500 expects 1..12 for the month field,
causing invalid date errors for January, and causing the day field to
roll over incorrectly.

The century flag is only handled in vt8500_rtc_read_time, but not set in
vt8500_rtc_set_time.  This patch corrects the behaviour of the century
flag.

Signed-off-by: Edgar Toernig <froese@gmx.de>
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/rtc/rtc-vt8500.c