Skip to content

Commit a10ed4c

Browse files
caihuoqing1990ambarus
authored andcommitted
mtd: spi-nor: hisi-sfc: 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 <[email protected]> Signed-off-by: Tudor Ambarus <[email protected]> Acked-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 78e4d34 commit a10ed4c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

drivers/mtd/spi-nor/controllers/hisi-sfc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ static int hisi_spi_nor_register_all(struct hifmc_host *host)
421421
static int hisi_spi_nor_probe(struct platform_device *pdev)
422422
{
423423
struct device *dev = &pdev->dev;
424-
struct resource *res;
425424
struct hifmc_host *host;
426425
int ret;
427426

@@ -432,13 +431,11 @@ static int hisi_spi_nor_probe(struct platform_device *pdev)
432431
platform_set_drvdata(pdev, host);
433432
host->dev = dev;
434433

435-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
436-
host->regbase = devm_ioremap_resource(dev, res);
434+
host->regbase = devm_platform_ioremap_resource_byname(pdev, "control");
437435
if (IS_ERR(host->regbase))
438436
return PTR_ERR(host->regbase);
439437

440-
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory");
441-
host->iobase = devm_ioremap_resource(dev, res);
438+
host->iobase = devm_platform_ioremap_resource_byname(pdev, "memory");
442439
if (IS_ERR(host->iobase))
443440
return PTR_ERR(host->iobase);
444441

0 commit comments

Comments
 (0)