[PATCH] rtc: rtc-pic32: handle clock enable failure

Jiawen Liu posted 1 patch 1 month, 1 week ago
[PATCH] rtc: rtc-pic32: handle clock enable failure
Posted by Jiawen Liu 1 month, 1 week ago
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);
Re: [PATCH] rtc: rtc-pic32: handle clock enable failure
Posted by Markus Elfring 1 month, 1 week ago
…
> Check early clk_prepare_enable(pdata->clk) return in pic32_rtc_probe.

I find such a wording approach improvable.
How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?

See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v7.2#n34
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n145
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n792


The message recipient specifications should be extended.

Regards,
Markus
Re: [PATCH] rtc: rtc-pic32: handle clock enable failure
Posted by Robert P. J. Day 1 month, 1 week ago
On Thu, 20 Aug 2026, Markus Elfring wrote:

> …
> > Check early clk_prepare_enable(pdata->clk) return in pic32_rtc_probe.
>
> I find such a wording approach improvable.
> How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?

  How many times are you going to ask this same question?

rday
Re: rtc: rtc-pic32: handle clock enable failure
Posted by Markus Elfring 1 month, 1 week ago
>> …
>>> Check early clk_prepare_enable(pdata->clk) return in pic32_rtc_probe.
>>
>> I find such a wording approach improvable.
>> How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
> 
>   How many times are you going to ask this same question?
I got the impression that another reminder would be needed also for the presented patch.

Regards,
Markus