Skip to content
Commit a1e98e09 authored by Benoît Thébaudeau's avatar Benoît Thébaudeau Committed by Alexandre Belloni
Browse files

rtc: rv8803: Fix read day of week



The Weekday register is encoded as 2^tm_wday, with tm_wday in 0..6, so
using tm_wday = ffs(reg) to fill tm_wday from the register value is
wrong because this gives the expected value + 1. This could be fixed as
tm_wday = ffs(reg) - 1, but tm_wday = ilog2(reg) works as well and is
more direct.

Signed-off-by: default avatarBenoît Thébaudeau <benoit@wsystem.com>
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@free-electrons.com>
parent 96acb25c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment