Bug 7361 - bug in rtc-max6902.c
Summary: bug in rtc-max6902.c
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: drivers_other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-13 12:50 UTC by Francisco Larramendi
Modified: 2006-10-13 13:24 UTC (History)
0 users

See Also:
Kernel Version: 2.6.19-rc2 and previous
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Francisco Larramendi 2006-10-13 12:50:26 UTC
Most recent kernel where this bug did not occur:
Distribution:
Hardware Environment:
Software Environment:
Problem Description:
hwclock returns an improper date reading a max6902 rtc in october 

Steps to reproduce:
In a machine with a max6902 rtc, in october, just run hwclok

Fix:
In drivers/rtc/rtc-max6902.c, function max6902_get_datetime, line 139:

dt->tm_mon      = BCD2BIN(chip->buf[5] - 1);

should be replaced for:

dt->tm_mon      = BCD2BIN(chip->buf[5]) - 1;

Explanetion: first convert to binary and then decrement.
Fortunately is only detectable in october.
Comment 1 Andrew Morton 2006-10-13 13:24:28 UTC
I queued a fix, thanks.

Note You need to log in before you can comment on or make changes to this bug.