From 60c66130a4467ca2a2994a6e3d7d5ac63839eefb Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 31 Mar 2009 23:23:05 -0300 Subject: rtc-pcf50606: Fix month off-by-one error According to the PCF50606 manual, the issues resoved by commit cc1663fc922c03feb0d7bbb8b18d62fbac0128de also exists there. Signed-off-by: Werner Almesberger Reported-by: Rask Ingemann Lambertsen --- drivers/rtc/rtc-pcf50606.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/rtc') diff --git a/drivers/rtc/rtc-pcf50606.c b/drivers/rtc/rtc-pcf50606.c index e059093d908..434cfc1dca4 100644 --- a/drivers/rtc/rtc-pcf50606.c +++ b/drivers/rtc/rtc-pcf50606.c @@ -70,7 +70,7 @@ static void pcf2rtc_time(struct rtc_time *rtc, struct pcf50606_time *pcf) rtc->tm_hour = bcd2bin(pcf->time[PCF50606_TI_HOUR]); rtc->tm_wday = bcd2bin(pcf->time[PCF50606_TI_WKDAY]); rtc->tm_mday = bcd2bin(pcf->time[PCF50606_TI_DAY]); - rtc->tm_mon = bcd2bin(pcf->time[PCF50606_TI_MONTH]); + rtc->tm_mon = bcd2bin(pcf->time[PCF50606_TI_MONTH]) - 1; rtc->tm_year = bcd2bin(pcf->time[PCF50606_TI_YEAR]) + 100; } @@ -81,7 +81,7 @@ static void rtc2pcf_time(struct pcf50606_time *pcf, struct rtc_time *rtc) pcf->time[PCF50606_TI_HOUR] = bin2bcd(rtc->tm_hour); pcf->time[PCF50606_TI_WKDAY] = bin2bcd(rtc->tm_wday); pcf->time[PCF50606_TI_DAY] = bin2bcd(rtc->tm_mday); - pcf->time[PCF50606_TI_MONTH] = bin2bcd(rtc->tm_mon); + pcf->time[PCF50606_TI_MONTH] = bin2bcd(rtc->tm_mon + 1); pcf->time[PCF50606_TI_YEAR] = bin2bcd(rtc->tm_year % 100); } -- cgit v1.2.3