From: Jan Kardell Date: Wed, 10 Dec 2014 23:53:37 +0000 (-0800) Subject: rtc: pcf8563: fix wrong time from read_alarm X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c7aef4f88629dcd6efbf9c80c9805625e149c868;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git rtc: pcf8563: fix wrong time from read_alarm Incorrect mask was used for hour and monthday fields. Signed-off-by: Jan Kardell Cc: Alessandro Zummo Cc: Grant Likely Cc: Rob Herring Cc: Vincent Donnefort Cc: Dan Carpenter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c index 8c23606ce2cc..78f76d99bd35 100644 --- a/drivers/rtc/rtc-pcf8563.c +++ b/drivers/rtc/rtc-pcf8563.c @@ -336,8 +336,8 @@ static int pcf8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm) __func__, buf[0], buf[1], buf[2], buf[3]); tm->time.tm_min = bcd2bin(buf[0] & 0x7F); - tm->time.tm_hour = bcd2bin(buf[1] & 0x7F); - tm->time.tm_mday = bcd2bin(buf[2] & 0x1F); + tm->time.tm_hour = bcd2bin(buf[1] & 0x3F); + tm->time.tm_mday = bcd2bin(buf[2] & 0x3F); tm->time.tm_wday = bcd2bin(buf[3] & 0x7); tm->time.tm_mon = -1; tm->time.tm_year = -1;