From: Vinod Koul <vkoul@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Michal Simek <michal.simek@amd.com>,
dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2] dmaengine: axi-dmac: Simplify with scoped for each OF child loop
Date: Thu, 1 Jan 2026 17:21:15 +0530 [thread overview]
Message-ID: <aVZfs3yPrkWYwNCw@vaman> (raw)
In-Reply-To: <20251224124531.208682-3-krzysztof.kozlowski@oss.qualcomm.com>
On 24-12-25, 13:45, Krzysztof Kozlowski wrote:
> Use scoped for-each loop when iterating over device nodes to make code a
> bit simpler.
Hey Krzysztof,
This fails to apply for me, can you please rebase and post again
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
> ---
> drivers/dma/dma-axi-dmac.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c
> index 5b06b0dc67ee..45364b1e47f4 100644
> --- a/drivers/dma/dma-axi-dmac.c
> +++ b/drivers/dma/dma-axi-dmac.c
> @@ -925,24 +925,21 @@ static int axi_dmac_parse_chan_dt(struct device_node *of_chan,
>
> static int axi_dmac_parse_dt(struct device *dev, struct axi_dmac *dmac)
> {
> - struct device_node *of_channels, *of_chan;
> - int ret;
> + struct device_node *of_channels;
> + int ret = 0;
>
> of_channels = of_get_child_by_name(dev->of_node, "adi,channels");
> if (of_channels == NULL)
> return -ENODEV;
>
> - for_each_child_of_node(of_channels, of_chan) {
> + for_each_child_of_node_scoped(of_channels, of_chan) {
> ret = axi_dmac_parse_chan_dt(of_chan, &dmac->chan);
> - if (ret) {
> - of_node_put(of_chan);
> - of_node_put(of_channels);
> - return -EINVAL;
> - }
> + if (ret)
> + break;
> }
> of_node_put(of_channels);
>
> - return 0;
> + return ret;
> }
>
> static int axi_dmac_read_chan_config(struct device *dev, struct axi_dmac *dmac)
> --
> 2.51.0
--
~Vinod
prev parent reply other threads:[~2026-01-01 11:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-24 12:45 [PATCH 1/2] dmaengine: axi-dmac: Simplify with scoped for each OF child loop Krzysztof Kozlowski
2025-12-24 12:45 ` [PATCH 2/2] dmaengine: xilinx: " Krzysztof Kozlowski
2026-01-01 11:51 ` Vinod Koul [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=aVZfs3yPrkWYwNCw@vaman \
--to=vkoul@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=krzysztof.kozlowski@oss.qualcomm.com \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.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;
as well as URLs for NNTP newsgroup(s).