2023-07-06 04:04:51

by 李扬韬

[permalink] [raw]
Subject: [PATCH 1/7] spi: atmel: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/spi/spi-atmel.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 152cd6773403..8a9c8b92be8c 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1450,10 +1450,6 @@ static int atmel_spi_probe(struct platform_device *pdev)
/* Select default pin state */
pinctrl_pm_select_default_state(&pdev->dev);

- regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!regs)
- return -ENXIO;
-
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
@@ -1490,7 +1486,7 @@ static int atmel_spi_probe(struct platform_device *pdev)
spin_lock_init(&as->lock);

as->pdev = pdev;
- as->regs = devm_ioremap_resource(&pdev->dev, regs);
+ as->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &regs);
if (IS_ERR(as->regs)) {
ret = PTR_ERR(as->regs);
goto out_unmap_regs;
--
2.39.0



2023-07-06 04:05:48

by 李扬韬

[permalink] [raw]
Subject: [PATCH 5/7] spi: rspi: Use devm_platform_get_and_ioremap_resource()

Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Signed-off-by: Yangtao Li <[email protected]>
---
drivers/spi/spi-rspi.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 08ceebbaf69b..9312a9d58a1b 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -1317,8 +1317,7 @@ static int rspi_probe(struct platform_device *pdev)
rspi->ops = ops;
rspi->ctlr = ctlr;

- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- rspi->addr = devm_ioremap_resource(&pdev->dev, res);
+ rspi->addr = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(rspi->addr)) {
ret = PTR_ERR(rspi->addr);
goto error1;
--
2.39.0


2023-07-11 22:11:45

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 1/7] spi: atmel: Use devm_platform_get_and_ioremap_resource()

On Thu, 06 Jul 2023 11:27:20 +0800, Yangtao Li wrote:
> Convert platform_get_resource(), devm_ioremap_resource() to a single
> call to devm_platform_get_and_ioremap_resource(), as this is exactly
> what this function does.
>
>

Applied to

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

Thanks!

[1/7] spi: atmel: Use devm_platform_get_and_ioremap_resource()
commit: 616a733ccaee2412cd8def29f6f106e22c3cfabb
[2/7] spi: davinci: Use devm_platform_get_and_ioremap_resource()
commit: 2ae3c98b6e80f5b99afd9eafbdfab5146330dae5
[3/7] spi: ep93xx: Use devm_platform_get_and_ioremap_resource()
commit: cb8ea3dd55acd191f80847488d2231a1d18ab1ed
[4/7] spi: spi-nxp-fspi: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname()
commit: 8c8e947b6be037d0a311f11688212c7d87aa5440
[5/7] spi: rspi: Use devm_platform_get_and_ioremap_resource()
commit: b778d967979d7ed638fe1de8c2465ff33ace47d8
[6/7] spi: tegra20-slink: Use devm_platform_get_and_ioremap_resource()
commit: 2e4ed2577936476e0e9bb9a07158e94effb86285
[7/7] spi: s3c64xx: Use devm_platform_get_and_ioremap_resource()
commit: 4f81b540ccdf023b7b39432f5c0a26c7eadcc9ce

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