mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
drivers/rtc/rtc-vt8500.c: fix year field in vt8500_rtc_set_time()
The year field is incorrectly masked when setting the date. If the year is beyond 2099, the year field will be incorrectly updated in hardware. This patch masks the year field correctly. Signed-off-by: Edgar Toernig <[email protected]> Signed-off-by: Tony Prisk <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
1363b563a7
commit
3bdf8cd322
1 changed files with 1 additions and 1 deletions
|
|
@ -137,7 +137,7 @@ static int vt8500_rtc_set_time(struct device *dev, struct rtc_time *tm)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S)
|
||||
writel((bin2bcd(tm->tm_year % 100) << DATE_YEAR_S)
|
||||
| (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S)
|
||||
| (bin2bcd(tm->tm_mday))
|
||||
| ((tm->tm_year >= 200) << DATE_CENTURY_S),
|
||||
|
|
|
|||
Loading…
Reference in a new issue