armbian_build/patch/kernel/archive/sunxi-6.15/patches.megous/rtc-Print-which-error-caused-RTC-read-failure.patch
2025-06-11 19:40:28 +02:00

32 lines
925 B
Diff

From 42dea1676c644552b72e4723f2c004f33d89cf31 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sat, 2 Mar 2024 15:08:57 +0100
Subject: rtc: Print which error caused RTC read failure
Currently we can't know from kernel log, whether the read failed due
to I2C bus error, or invalid time value, etc. Print the error in error
message.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
drivers/rtc/class.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index b88cd4fb295b..47d1c9d835a8 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -66,7 +66,8 @@ static void rtc_hctosys(struct rtc_device *rtc)
err = rtc_read_time(rtc, &tm);
if (err) {
dev_err(rtc->dev.parent,
- "hctosys: unable to read the hardware clock\n");
+ "hctosys: unable to read the hardware clock %pe\n",
+ ERR_PTR(err));
goto err_read;
}
--
2.35.3