public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] spi: wpcm-fiu: Use devm_platform_ioremap_resource_byname()
@ 2024-08-20 12:35 Jinjie Ruan
  2024-08-23 12:15 ` J. Neuschäfer
  2024-08-23 22:57 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Jinjie Ruan @ 2024-08-20 12:35 UTC (permalink / raw)
  To: j.neuschaefer, broonie, openbmc, linux-spi, linux-kernel; +Cc: ruanjinjie

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>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] spi: wpcm-fiu: Use devm_platform_ioremap_resource_byname()
  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
  2024-08-23 22:57 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: J. Neuschäfer @ 2024-08-23 12:15 UTC (permalink / raw)
  To: Jinjie Ruan; +Cc: j.neuschaefer, broonie, openbmc, linux-spi, linux-kernel

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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] spi: wpcm-fiu: Use devm_platform_ioremap_resource_byname()
  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
@ 2024-08-23 22:57 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-08-23 22:57 UTC (permalink / raw)
  To: j.neuschaefer, openbmc, linux-spi, linux-kernel, Jinjie Ruan

On Tue, 20 Aug 2024 20:35:18 +0800, Jinjie Ruan wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: wpcm-fiu: Use devm_platform_ioremap_resource_byname()
      commit: 3bf2a5359b0bde22418705ec862ac5077312e4c2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-23 22:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2024-08-23 22:57 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox