From: Frank Li <Frank.li@oss.nxp.com>
To: Rosen Penev <rosenp@gmail.com>
Cc: dmaengine@vger.kernel.org, Vinod Koul <vkoul@kernel.org>,
Frank Li <Frank.Li@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
open list <linux-kernel@vger.kernel.org>,
"open list:CLANG/LLVM BUILD SUPPORT:Keyword:b(?i:clang|llvm)b"
<llvm@lists.linux.dev>
Subject: Re: [PATCH] dmaengine: mv_xor: use devm_platform_ioremap_resource()
Date: Thu, 24 Sep 2026 15:04:29 -0400 [thread overview]
Message-ID: <arV0PT10meJEfeim@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260714002803.1414307-1-rosenp@gmail.com>
On Mon, Jul 13, 2026 at 05:28:03PM -0700, Rosen Penev wrote:
> Replace the two open-coded platform_get_resource() plus devm_ioremap()
> sequences with devm_platform_ioremap_resource() for the low and high XOR
> register windows. This folds the resource lookup and mapping into a
> single call and returns an ERR_PTR on failure, checked with IS_ERR() and
> propagated via PTR_ERR().
>
> devm_platform_ioremap_resource() reserves the region via
> devm_request_mem_region(), which requires non-overlapping reg ranges. All
> XOR nodes in the Marvell DTS describe two distinct 0x100 register windows
> that do not overlap each other, and sibling XOR nodes interleave without
> overlapping, so the newly-reserving mapping introduces no region
> conflict.
>
> Built for ARM (defconfig + CONFIG_MV_XOR) with LLVM=1;
> drivers/dma/mv_xor.o compiles cleanly.
Nit: suppose pass build is neccesary steps before post patch. So needn't
mention it commit message.
Reviewed-by: Frank Li <Frank.Li@nxp.com>
>
> Assisted-by: opencode:hy3-free
> Signed-off-by: Rosen Penev <rosenp@gmail.com>
> ---
> drivers/dma/mv_xor.c | 23 ++++++-----------------
> 1 file changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
> index 25ed61f1b089..fe2e6b9ec185 100644
> --- a/drivers/dma/mv_xor.c
> +++ b/drivers/dma/mv_xor.c
> @@ -1309,7 +1309,6 @@ static int mv_xor_probe(struct platform_device *pdev)
> const struct mbus_dram_target_info *dram;
> struct mv_xor_device *xordev;
> struct mv_xor_platform_data *pdata = dev_get_platdata(&pdev->dev);
> - struct resource *res;
> unsigned int max_engines, max_channels;
> int i, ret;
>
> @@ -1319,23 +1318,13 @@ static int mv_xor_probe(struct platform_device *pdev)
> if (!xordev)
> return -ENOMEM;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!res)
> - return -ENODEV;
> + xordev->xor_base = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(xordev->xor_base))
> + return PTR_ERR(xordev->xor_base);
>
> - xordev->xor_base = devm_ioremap(&pdev->dev, res->start,
> - resource_size(res));
> - if (!xordev->xor_base)
> - return -EBUSY;
> -
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> - if (!res)
> - return -ENODEV;
> -
> - xordev->xor_high_base = devm_ioremap(&pdev->dev, res->start,
> - resource_size(res));
> - if (!xordev->xor_high_base)
> - return -EBUSY;
> + xordev->xor_high_base = devm_platform_ioremap_resource(pdev, 1);
> + if (IS_ERR(xordev->xor_high_base))
> + return PTR_ERR(xordev->xor_high_base);
>
> platform_set_drvdata(pdev, xordev);
>
> --
> 2.55.0
>
prev parent reply other threads:[~2026-09-24 19:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 0:28 Rosen Penev
2026-09-24 19:04 ` Frank Li [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=arV0PT10meJEfeim@lizhi-Precision-Tower-5810 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=rosenp@gmail.com \
--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
all inboxes | Powered by JetHome®