diff options
author | Alexander Kochetkov <al.kochet@gmail.com> | 2016-03-06 12:43:57 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-04 14:51:25 -0700 |
commit | 48257cde6bf54aae77fee7641b483369e061c21f (patch) | |
tree | f4557f23a432a3a057e64c9d89bf973c3ae7e8be | |
parent | 314e5b76c3fc8263f4e6187718ab32ee27cf7c98 (diff) | |
download | lwn-48257cde6bf54aae77fee7641b483369e061c21f.tar.gz lwn-48257cde6bf54aae77fee7641b483369e061c21f.zip |
rtc: hym8563: fix invalid year calculation
commit d5861262210067fc01b2fb4f7af2fd85a3453f15 upstream.
Year field must be in BCD format, according to
hym8563 datasheet.
Due to the bug year 2016 became 2010.
Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver")
Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/rtc/rtc-hym8563.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c index e5f13c4310fe..ea99fffd5556 100644 --- a/drivers/rtc/rtc-hym8563.c +++ b/drivers/rtc/rtc-hym8563.c @@ -144,7 +144,7 @@ static int hym8563_rtc_set_time(struct device *dev, struct rtc_time *tm) * it does not seem to carry it over a subsequent write/read. * So we'll limit ourself to 100 years, starting at 2000 for now. */ - buf[6] = tm->tm_year - 100; + buf[6] = bin2bcd(tm->tm_year - 100); /* * CTL1 only contains TEST-mode bits apart from stop, |