From: Frank Li <Frank.li@oss.nxp.com>
To: Jiawen Liu <1298662399@qq.com>
Cc: Paul Cercueil <paul@crapouillou.net>,
Vinod Koul <vkoul@kernel.org>,
linux-mips@vger.kernel.org, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org, Frank Li <Frank.Li@kernel.org>
Subject: Re: [PATCH] dma: jz4780: handle clk_prepare_enable() failure in probe
Date: Tue, 18 Aug 2026 11:27:55 -0500 [thread overview]
Message-ID: <aoSIC1r-xAelQ9s1@SMW015318> (raw)
In-Reply-To: <tencent_BE00B17EBF2A95EADD8B80203B745B9C7609@qq.com>
On Tue, Aug 18, 2026 at 04:41:31PM +0400, Jiawen Liu wrote:
> From: jiawen <1298662399@qq.com>
subject:
dmaengine: jz4780: propagate the return value of clk_prepare_enable() in probe
Frank
>
> jz4780_dma_probe() ignores the return value of clk_prepare_enable(). If
> the clock fails to enable, the driver continues and may later attempt to
> disable an unprepared clock on error paths, leading to unbalanced clock
> operations.
>
> Check the return value and propagate the error immediately, avoiding the
> erroneous cleanup.
>
> Signed-off-by: jiawen <1298662399@qq.com>
> ---
> diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
> --- a/drivers/dma/dma-jz4780.c
> +++ b/drivers/dma/dma-jz4780.c
> @@ -903,7 +903,9 @@
> return ret;
> }
>
> - clk_prepare_enable(jzdma->clk);
> + ret = clk_prepare_enable(jzdma->clk);
> + if (ret)
> + return ret;
>
> /* Property is optional, if it doesn't exist the value will remain 0. */
> of_property_read_u32_index(dev->of_node, "ingenic,reserved-channels",
>
next prev parent reply other threads:[~2026-08-18 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 12:41 [PATCH] dma: jz4780: handle clk_prepare_enable() failure in probe Jiawen Liu
2026-08-18 12:52 ` sashiko-bot
2026-08-18 16:27 ` Frank Li [this message]
2026-08-19 15:32 ` 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=aoSIC1r-xAelQ9s1@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=1298662399@qq.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=paul@crapouillou.net \
--cc=vkoul@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