aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
authorWerner Almesberger <werner@openmoko.org>2009-03-31 23:23:05 -0300
committerWerner Almesberger <werner@openmoko.org>2009-03-31 23:23:05 -0300
commit60c66130a4467ca2a2994a6e3d7d5ac63839eefb (patch)
treea332a9f94136b70fb441610abf27093ce48166f2 /drivers/rtc
parent34152a920a7e529ba65ded0a8024492026e68356 (diff)
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 <werner@openmoko.org> Reported-by: Rask Ingemann Lambertsen <rask@sygehus.dk>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-pcf50606.c4
1 files changed, 2 insertions, 2 deletions
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);
}