summaryrefslogtreecommitdiff
path: root/drivers/rtc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-tps6591x.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-tps6591x.c b/drivers/rtc/rtc-tps6591x.c
index 878c2046aac7..cab3e8874dff 100644
--- a/drivers/rtc/rtc-tps6591x.c
+++ b/drivers/rtc/rtc-tps6591x.c
@@ -161,7 +161,7 @@ static int tps6591x_rtc_read_time(struct device *dev, struct rtc_time *tm)
tm->tm_min = buff[1];
tm->tm_hour = buff[2];
tm->tm_mday = buff[3];
- tm->tm_mon = buff[4];
+ tm->tm_mon = buff[4] - 1;
tm->tm_year = buff[5];
tm->tm_wday = buff[6];
print_time(dev, tm);
@@ -249,7 +249,7 @@ static int tps6591x_rtc_set_time(struct device *dev, struct rtc_time *tm)
buff[1] = tm->tm_min;
buff[2] = tm->tm_hour;
buff[3] = tm->tm_mday;
- buff[4] = tm->tm_mon;
+ buff[4] = tm->tm_mon + 1;
buff[5] = tm->tm_year;
buff[6] = tm->tm_wday;
@@ -308,7 +308,7 @@ static int tps6591x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
buff[1] = alrm->time.tm_min;
buff[2] = alrm->time.tm_hour;
buff[3] = alrm->time.tm_mday;
- buff[4] = alrm->time.tm_mon;
+ buff[4] = alrm->time.tm_mon + 1;
buff[5] = alrm->time.tm_year;
convert_decimal_to_bcd(buff, sizeof(buff));
err = tps6591x_write_regs(dev, RTC_ALARM, sizeof(buff), buff);
@@ -332,7 +332,7 @@ static int tps6591x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
alrm->time.tm_min = buff[1];
alrm->time.tm_hour = buff[2];
alrm->time.tm_mday = buff[3];
- alrm->time.tm_mon = buff[4];
+ alrm->time.tm_mon = buff[4] - 1;
alrm->time.tm_year = buff[5];
dev_info(dev->parent, "\n getting alarm time::\n");