[PATCH] mtd: spi-nor: nxp-spifi: Make use of the helper function devm_platform_ioremap_resource_byname()

Subsystems: arm/lpc18xx architecture, memory technology devices (mtd), spi nor subsystem, the rest

STALE1820d LANDED

Landed in mainline as df872ab1ffe4 on 2021-10-15.

3 messages, 3 authors, 2021-10-19 · open the first message on its own page

[PATCH] mtd: spi-nor: nxp-spifi: Make use of the helper function devm_platform_ioremap_resource_byname()

From: Cai Huoqing <hidden>
Date: 2021-09-01 07:43:27

Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <redacted>
---
 drivers/mtd/spi-nor/controllers/nxp-spifi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/mtd/spi-nor/controllers/nxp-spifi.c b/drivers/mtd/spi-nor/controllers/nxp-spifi.c
index 2635c80231bb..9032b9ab2eaf 100644
--- a/drivers/mtd/spi-nor/controllers/nxp-spifi.c
+++ b/drivers/mtd/spi-nor/controllers/nxp-spifi.c
@@ -381,20 +381,17 @@ static int nxp_spifi_probe(struct platform_device *pdev)
 {
 	struct device_node *flash_np;
 	struct nxp_spifi *spifi;
-	struct resource *res;
 	int ret;
 
 	spifi = devm_kzalloc(&pdev->dev, sizeof(*spifi), GFP_KERNEL);
 	if (!spifi)
 		return -ENOMEM;
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spifi");
-	spifi->io_base = devm_ioremap_resource(&pdev->dev, res);
+	spifi->io_base = devm_platform_ioremap_resource_byname(pdev, "spifi");
 	if (IS_ERR(spifi->io_base))
 		return PTR_ERR(spifi->io_base);
 
-	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "flash");
-	spifi->flash_base = devm_ioremap_resource(&pdev->dev, res);
+	spifi->flash_base = devm_platform_ioremap_resource_byname(pdev, "flash");
 	if (IS_ERR(spifi->flash_base))
 		return PTR_ERR(spifi->flash_base);
 
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH] mtd: spi-nor: nxp-spifi: Make use of the helper function devm_platform_ioremap_resource_byname()

From: Pratyush Yadav <hidden>
Date: 2021-09-01 11:42:01

On 01/09/21 03:43PM, Cai Huoqing wrote:
Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <redacted>
Acked-by: Pratyush Yadav <redacted>

-- 
Regards,
Pratyush Yadav
Texas Instruments Inc.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH] mtd: spi-nor: nxp-spifi: Make use of the helper function devm_platform_ioremap_resource_byname()

From: <hidden>
Date: 2021-10-19 10:17:31

On 9/1/21 10:43 AM, Cai Huoqing wrote:
Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <redacted>
---
 drivers/mtd/spi-nor/controllers/nxp-spifi.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Applied, thanks.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help