From: "J. Neuschäfer" <j.neuschaefer@gmx.net>
To: Jinjie Ruan <ruanjinjie@huawei.com>
Cc: j.neuschaefer@gmx.net, broonie@kernel.org,
openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] spi: wpcm-fiu: Use devm_platform_ioremap_resource_byname()
Date: Fri, 23 Aug 2024 14:15:12 +0200 [thread overview]
Message-ID: <Zsh9UA4iXvMzm2HW@probook> (raw)
In-Reply-To: <20240820123518.1788294-1-ruanjinjie@huawei.com>
On Tue, Aug 20, 2024 at 08:35:18PM +0800, Jinjie Ruan wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Looks good to me, thanks!
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
> ---
> drivers/spi/spi-wpcm-fiu.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c
> index 886d6d7771d4..47e485fd8f84 100644
> --- a/drivers/spi/spi-wpcm-fiu.c
> +++ b/drivers/spi/spi-wpcm-fiu.c
> @@ -448,8 +448,7 @@ static int wpcm_fiu_probe(struct platform_device *pdev)
> fiu = spi_controller_get_devdata(ctrl);
> fiu->dev = dev;
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
> - fiu->regs = devm_ioremap_resource(dev, res);
> + fiu->regs = devm_platform_ioremap_resource_byname(pdev, "control");
> if (IS_ERR(fiu->regs)) {
> dev_err(dev, "Failed to map registers\n");
> return PTR_ERR(fiu->regs);
> @@ -459,8 +458,7 @@ static int wpcm_fiu_probe(struct platform_device *pdev)
> if (IS_ERR(fiu->clk))
> return PTR_ERR(fiu->clk);
>
> - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory");
> - fiu->memory = devm_ioremap_resource(dev, res);
> + fiu->memory = devm_platform_ioremap_resource_byname(pdev, "memory");
> fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL);
> if (IS_ERR(fiu->memory)) {
> dev_err(dev, "Failed to map flash memory window\n");
> --
> 2.34.1
>
next prev parent reply other threads:[~2024-08-23 12:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-20 12:35 [PATCH -next] spi: wpcm-fiu: Use devm_platform_ioremap_resource_byname() Jinjie Ruan
2024-08-23 12:15 ` J. Neuschäfer [this message]
2024-08-23 22:57 ` Mark Brown
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=Zsh9UA4iXvMzm2HW@probook \
--to=j.neuschaefer@gmx.net \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=openbmc@lists.ozlabs.org \
--cc=ruanjinjie@huawei.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