diff options
author | Paul Kocialkowski <paul.kocialkowski@bootlin.com> | 2019-12-12 16:31:11 +0100 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2019-12-23 11:18:06 +0100 |
commit | e2ed7507ae89b92b67025f221448b543e2333b21 (patch) | |
tree | 525ea891e51431438de58b95a7198efa81fac5f2 /drivers/rtc/rtc-ab-eoz9.c | |
parent | rtc: hym8563: Return -EINVAL if the time is known to be invalid (diff) | |
download | linux-e2ed7507ae89b92b67025f221448b543e2333b21.tar.xz linux-e2ed7507ae89b92b67025f221448b543e2333b21.zip |
rtc: hym8563: Read the valid flag directly instead of caching it
The RTC has a valid bit in the seconds register that indicates whether
power was lost since the pevious time set. This bit is currently read
once at probe time, cached and updated with set_time.
Howeever, caching the bit may prevent detecting power loss at runtime
(which can happen if the RTC's supply is distinct from the the platform's).
Writing the seconds register when setting time will clear the bit,
so there should be no downside in reading the bit directly instead of
caching it.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Link: https://lore.kernel.org/r/20191212153111.966923-2-paul.kocialkowski@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/rtc/rtc-ab-eoz9.c')
0 files changed, 0 insertions, 0 deletions