]> www.infradead.org Git - users/dwmw2/linux.git/commit
rtc: hym8563: Return -EINVAL if the time is known to be invalid
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Thu, 12 Dec 2019 15:31:10 +0000 (16:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Feb 2020 21:53:00 +0000 (16:53 -0500)
commit1a3610b8e45cd91bbeb39fe47003463f20cca322
treef81ca7dd007a75730cec998613756e45e989961e
parentf698c219481726166b09121e5e636b0ed3ba0edc
rtc: hym8563: Return -EINVAL if the time is known to be invalid

commit f236a2a2ebabad0848ad0995af7ad1dc7029e895 upstream.

The current code returns -EPERM when the voltage loss bit is set.
Since the bit indicates that the time value is not valid, return
-EINVAL instead, which is the appropriate error code for this
situation.

Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver")
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Link: https://lore.kernel.org/r/20191212153111.966923-1-paul.kocialkowski@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/rtc/rtc-hym8563.c