aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-pcf50606.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-pcf50606.c')
-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);
}