aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/rtc/rtc-sh.c')
-rw-r--r--drivers/rtc/rtc-sh.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 1ffc01ea730e..8f22eb1aff5c 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -268,7 +268,7 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
268 tm->tm_hour = BCD2BIN(readb(rtc->regbase + RHRCNT)); 268 tm->tm_hour = BCD2BIN(readb(rtc->regbase + RHRCNT));
269 tm->tm_wday = BCD2BIN(readb(rtc->regbase + RWKCNT)); 269 tm->tm_wday = BCD2BIN(readb(rtc->regbase + RWKCNT));
270 tm->tm_mday = BCD2BIN(readb(rtc->regbase + RDAYCNT)); 270 tm->tm_mday = BCD2BIN(readb(rtc->regbase + RDAYCNT));
271 tm->tm_mon = BCD2BIN(readb(rtc->regbase + RMONCNT)); 271 tm->tm_mon = BCD2BIN(readb(rtc->regbase + RMONCNT)) - 1;
272 272
273#if defined(CONFIG_CPU_SH4) 273#if defined(CONFIG_CPU_SH4)
274 yr = readw(rtc->regbase + RYRCNT); 274 yr = readw(rtc->regbase + RYRCNT);
@@ -296,7 +296,7 @@ static int sh_rtc_read_time(struct device *dev, struct rtc_time *tm)
296 "mday=%d, mon=%d, year=%d, wday=%d\n", 296 "mday=%d, mon=%d, year=%d, wday=%d\n",
297 __FUNCTION__, 297 __FUNCTION__,
298 tm->tm_sec, tm->tm_min, tm->tm_hour, 298 tm->tm_sec, tm->tm_min, tm->tm_hour,
299 tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday); 299 tm->tm_mday, tm->tm_mon + 1, tm->tm_year, tm->tm_wday);
300 300
301 if (rtc_valid_tm(tm) < 0) 301 if (rtc_valid_tm(tm) < 0)
302 dev_err(dev, "invalid date\n"); 302 dev_err(dev, "invalid date\n");
@@ -323,7 +323,7 @@ static int sh_rtc_set_time(struct device *dev, struct rtc_time *tm)
323 writeb(BIN2BCD(tm->tm_hour), rtc->regbase + RHRCNT); 323 writeb(BIN2BCD(tm->tm_hour), rtc->regbase + RHRCNT);
324 writeb(BIN2BCD(tm->tm_wday), rtc->regbase + RWKCNT); 324 writeb(BIN2BCD(tm->tm_wday), rtc->regbase + RWKCNT);
325 writeb(BIN2BCD(tm->tm_mday), rtc->regbase + RDAYCNT); 325 writeb(BIN2BCD(tm->tm_mday), rtc->regbase + RDAYCNT);
326 writeb(BIN2BCD(tm->tm_mon), rtc->regbase + RMONCNT); 326 writeb(BIN2BCD(tm->tm_mon + 1), rtc->regbase + RMONCNT);
327 327
328#ifdef CONFIG_CPU_SH3 328#ifdef CONFIG_CPU_SH3
329 year = tm->tm_year % 100; 329 year = tm->tm_year % 100;