aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/rtc/rtc-cmos.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-cmos.c b/drivers/rtc/rtc-cmos.c
index b48517021ee6..dcdc142a3441 100644
--- a/drivers/rtc/rtc-cmos.c
+++ b/drivers/rtc/rtc-cmos.c
@@ -198,9 +198,8 @@ static int cmos_set_alarm(struct device *dev, struct rtc_wkalrm *t)
198 198
199 /* Writing 0xff means "don't care" or "match all". */ 199 /* Writing 0xff means "don't care" or "match all". */
200 200
201 mon = t->time.tm_mon; 201 mon = t->time.tm_mon + 1;
202 mon = (mon < 12) ? BIN2BCD(mon) : 0xff; 202 mon = (mon <= 12) ? BIN2BCD(mon) : 0xff;
203 mon++;
204 203
205 mday = t->time.tm_mday; 204 mday = t->time.tm_mday;
206 mday = (mday >= 1 && mday <= 31) ? BIN2BCD(mday) : 0xff; 205 mday = (mday >= 1 && mday <= 31) ? BIN2BCD(mday) : 0xff;