]> git.baikalelectronics.ru Git - kernel.git/commit
rtc: pcf8523: don't return invalid date when battery is low
authorBaruch Siach <baruch@tkos.co.il>
Wed, 5 Dec 2018 15:00:09 +0000 (17:00 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 10 Dec 2018 23:46:53 +0000 (00:46 +0100)
commit442a99cfddd2fa4008b228796484ba2f5c0012c6
treef4a4f4047b3a8cfa6c82d104baefc0f1599db5bc
parentd9c1dfeaa7f09ec204a571d40800636fb963b128
rtc: pcf8523: don't return invalid date when battery is low

The RTC_VL_READ ioctl reports the low battery condition. Still,
pcf8523_rtc_read_time() happily returns invalid dates in this case.
Check the battery health on pcf8523_rtc_read_time() to avoid that.

Reported-by: Erik Čuk <erik.cuk@domel.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-pcf8523.c