Linux-RTC Archive on
 help / color / Atom feed
* [PATCH AUTOSEL 4.14 089/186] rtc: hym8563: Return -EINVAL if the time is known to be invalid
       [not found] <>
@ 2020-02-14 16:15 ` Sasha Levin
  0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2020-02-14 16:15 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Paul Kocialkowski, Alexandre Belloni, Sasha Levin, linux-rtc

From: Paul Kocialkowski <>

[ Upstream commit f236a2a2ebabad0848ad0995af7ad1dc7029e895 ]

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

Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver")
Signed-off-by: Paul Kocialkowski <>
Signed-off-by: Alexandre Belloni <>
Signed-off-by: Sasha Levin <>
 drivers/rtc/rtc-hym8563.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index e5ad527cb75e3..a8c2d38b24112 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -105,7 +105,7 @@ static int hym8563_rtc_read_time(struct device *dev, struct rtc_time *tm)
 	if (!hym8563->valid) {
 		dev_warn(&client->dev, "no valid clock/calendar values available\n");
-		return -EPERM;
+		return -EINVAL;
 	ret = i2c_smbus_read_i2c_block_data(client, HYM8563_SEC, 7, buf);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <>
2020-02-14 16:15 ` [PATCH AUTOSEL 4.14 089/186] rtc: hym8563: Return -EINVAL if the time is known to be invalid Sasha Levin

Linux-RTC Archive on

Archives are clonable:
	git clone --mirror linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ \
	public-inbox-index linux-rtc

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone