From: Jiawen Liu <1298662399@qq.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] rtc: rtc-pic32: handle clock enable failure
Date: Tue, 18 Aug 2026 17:10:26 +0400 [thread overview]
Message-ID: <tencent_7FCEEF77654C7D6B110DE49D2E98531A2006@qq.com> (raw)
Return error from failed clock enable.
Pic32 RTC ignores clk_prepare_enable return before hardware access and
later disables/unprepares clock same pic32 RTC unchecked
clk_prepare_enable.
Check early clk_prepare_enable(pdata->clk) return in pic32_rtc_probe.
Signed-off-by: jiawen <1298662399@qq.com>
---
diff --git a/drivers/rtc/rtc-pic32.c b/drivers/rtc/rtc-pic32.c
--- a/drivers/rtc/rtc-pic32.c
+++ b/drivers/rtc/rtc-pic32.c
@@ -325,7 +325,9 @@
if (IS_ERR(pdata->rtc))
return PTR_ERR(pdata->rtc);
- clk_prepare_enable(pdata->clk);
+ ret = clk_prepare_enable(pdata->clk);
+ if (ret)
+ return ret;
pic32_rtc_enable(pdata, 1);
next reply other threads:[~2026-08-18 13:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 13:10 Jiawen Liu [this message]
2026-08-20 9:35 ` Markus Elfring
2026-08-20 9:39 ` Robert P. J. Day
2026-08-20 10:04 ` Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tencent_7FCEEF77654C7D6B110DE49D2E98531A2006@qq.com \
--to=1298662399@qq.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®