From: Akinobu Mita Date: Sun, 10 Apr 2016 14:59:24 +0000 (+0900) Subject: rtc: ds1302: fix write value for day of week register X-Git-Tag: v4.7-rc1~86^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef50f86e15f2516658f0badd7890292d7a685106;p=platform%2Fkernel%2Flinux-exynos.git rtc: ds1302: fix write value for day of week register The valid range of day of week register for DS1302 is 1 to 7. But the set_time callback for rtc-ds1302 attempts to write the value of tm->tm_wday which is in the range 0 to 6. While the get_time callback correctly decodes the register. Signed-off-by: Akinobu Mita Cc: Sergey Yanovich Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-ds1302.c b/drivers/rtc/rtc-ds1302.c index 283e653..f5dd09f 100644 --- a/drivers/rtc/rtc-ds1302.c +++ b/drivers/rtc/rtc-ds1302.c @@ -65,7 +65,7 @@ static int ds1302_rtc_set_time(struct device *dev, struct rtc_time *time) *bp++ = bin2bcd(time->tm_hour); *bp++ = bin2bcd(time->tm_mday); *bp++ = bin2bcd(time->tm_mon + 1); - *bp++ = time->tm_wday; + *bp++ = time->tm_wday + 1; *bp++ = bin2bcd(time->tm_year % 100); *bp++ = RTC_CMD_WRITE_DISABLE;