Skip to content

Commit df872ab

Browse files
caihuoqing1990ambarus
authored andcommitted
mtd: spi-nor: nxp-spifi: Make use of the helper function devm_platform_ioremap_resource_byname()
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 <caihuoqing@baidu.com> Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Acked-by: Pratyush Yadav <p.yadav@ti.com> Link: https://lore.kernel.org/r/20210901074307.9733-1-caihuoqing@baidu.com
1 parent a10ed4c commit df872ab

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/mtd/spi-nor/controllers/nxp-spifi.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,20 +381,17 @@ static int nxp_spifi_probe(struct platform_device *pdev)
381381
{
382382
struct device_node *flash_np;
383383
struct nxp_spifi *spifi;
384-
struct resource *res;
385384
int ret;
386385

387386
spifi = devm_kzalloc(&pdev->dev, sizeof(*spifi), GFP_KERNEL);
388387
if (!spifi)
389388
return -ENOMEM;
390389

391-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "spifi");
392-
spifi->io_base = devm_ioremap_resource(&pdev->dev, res);
390+
spifi->io_base = devm_platform_ioremap_resource_byname(pdev, "spifi");
393391
if (IS_ERR(spifi->io_base))
394392
return PTR_ERR(spifi->io_base);
395393

396-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "flash");
397-
spifi->flash_base = devm_ioremap_resource(&pdev->dev, res);
394+
spifi->flash_base = devm_platform_ioremap_resource_byname(pdev, "flash");
398395
if (IS_ERR(spifi->flash_base))
399396
return PTR_ERR(spifi->flash_base);
400397

0 commit comments

Comments
 (0)