From: Jacky Huang <ychuang570808@gmail.com>
To: Cong Nguyen <congnt264@gmail.com>, Jacky Huang <ychuang3@nuvoton.com>
Cc: Shan-Chun Hung <schung@nuvoton.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: ma35d1: fix permanent clock reference/enable-count leak in probe
Date: Tue, 15 Sep 2026 14:08:09 +0800 [thread overview]
Message-ID: <4997b79c-fb9d-44be-a9ee-1af2d6e5d0f9@gmail.com> (raw)
In-Reply-To: <20260914131850.2331670-1-congnt264@gmail.com>
> diff --git a/drivers/rtc/rtc-ma35d1.c b/drivers/rtc/rtc-ma35d1.c
> index cfcfc28060f6..43358d68565a 100644
> --- a/drivers/rtc/rtc-ma35d1.c
> +++ b/drivers/rtc/rtc-ma35d1.c
> @@ -221,14 +221,10 @@ static int ma35d1_rtc_probe(struct platform_device *pdev)
> if (IS_ERR(rtc->rtc_reg))
> return PTR_ERR(rtc->rtc_reg);
>
> - clk = of_clk_get(pdev->dev.of_node, 0);
> + clk = devm_clk_get_enabled(&pdev->dev, NULL);
> if (IS_ERR(clk))
> return dev_err_probe(&pdev->dev, PTR_ERR(clk), "failed to find rtc clock\n");
>
> - ret = clk_prepare_enable(clk);
> - if (ret)
> - return ret;
> -
> if (!(rtc_reg_read(rtc, MA35_REG_RTC_INIT) & RTC_INIT_ACTIVE)) {
> ret = ma35d1_rtc_init(rtc, RTC_INIT_TIMEOUT);
> if (ret)
> --
> 2.25.1
>
Hi Cong,
Thanks for fixing this.
The conversion to devm_clk_get_enabled() correctly fixes the
clock reference and enable-count leak while preserving the RTC
clock behavior during the device lifetime.
Reviewed-by: Jacky Huang <ychuang3@nuvoton.com>
Best regards,
Jacky Huang
prev parent reply other threads:[~2026-09-15 6:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-14 13:18 Cong Nguyen
2026-09-15 6:08 ` Jacky Huang [this message]
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=4997b79c-fb9d-44be-a9ee-1af2d6e5d0f9@gmail.com \
--to=ychuang570808@gmail.com \
--cc=alexandre.belloni@bootlin.com \
--cc=congnt264@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=schung@nuvoton.com \
--cc=ychuang3@nuvoton.com \
/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®