Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] rtc-max6902: month conversion fix

Fix October-only BCD-to-binary conversion bug:

0x08 -> 7
0x09 -> 8
0x10 -> 15 (!)
0x11 -> 19

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=7361

Cc: Raphael Assenat <raph@raphnet.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Francisco Larramendi and committed by
Linus Torvalds
c430169e f9b2e97b

+1 -1
+1 -1
drivers/rtc/rtc-max6902.c
··· 136 136 dt->tm_min = BCD2BIN(chip->buf[2]); 137 137 dt->tm_hour = BCD2BIN(chip->buf[3]); 138 138 dt->tm_mday = BCD2BIN(chip->buf[4]); 139 - dt->tm_mon = BCD2BIN(chip->buf[5] - 1); 139 + dt->tm_mon = BCD2BIN(chip->buf[5]) - 1; 140 140 dt->tm_wday = BCD2BIN(chip->buf[6]); 141 141 dt->tm_year = BCD2BIN(chip->buf[7]); 142 142