linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] spi: atmel: Use devm_platform_get_and_ioremap_resource()
@ 2023-07-06  3:27 Yangtao Li
  2023-07-06  3:27 ` [PATCH 2/7] spi: davinci: " Yangtao Li
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Yangtao Li @ 2023-07-06  3:27 UTC (permalink / raw)
  To: Tudor Ambarus, Mark Brown, Nicolas Ferre, Alexandre Belloni,
	Claudiu Beznea
  Cc: Yangtao Li, linux-spi, linux-arm-kernel, linux-kernel

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 <frank.li@vivo.com>
---
 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


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

end of thread, other threads:[~2023-07-11 22:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-06  3:27 [PATCH 1/7] spi: atmel: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06  3:27 ` [PATCH 2/7] spi: davinci: " Yangtao Li
2023-07-06  3:27 ` [PATCH 3/7] spi: ep93xx: " Yangtao Li
2023-07-06  3:27 ` [PATCH 4/7] spi: spi-nxp-fspi: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname() Yangtao Li
2023-07-06  6:06   ` Bough Chen
2023-07-06  3:27 ` [PATCH 5/7] spi: rspi: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06  3:27 ` [PATCH 6/7] spi: tegra20-slink: " Yangtao Li
2023-07-07 13:01   ` Thierry Reding
2023-07-06  3:27 ` [PATCH 7/7] spi: s3c64xx: " Yangtao Li
2023-07-11 22:04 ` [PATCH 1/7] spi: atmel: " Mark Brown

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