Skip to content

Commit

Permalink
mtd: rawnand: fsmc: use devm_platform_ioremap_resource_byname()
Browse files Browse the repository at this point in the history
Convert platform_get_resource_byname(),devm_ioremap_resource() to a single
call to devm_platform_ioremap_resource_byname(), as this is exactly what
this function does.

Signed-off-by: Ye Xingchen <ye.xingchen@zte.com.cn>
  • Loading branch information
Ye Xingchen authored and intel-lab-lkp committed Mar 21, 2023
1 parent 4080d53 commit 21cf772
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/mtd/nand/raw/fsmc_nand.c
Expand Up @@ -1041,25 +1041,21 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
if (ret)
return ret;

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_data");
host->data_va = devm_ioremap_resource(&pdev->dev, res);
host->data_va = devm_platform_ioremap_resource_byname(pdev, "nand_data");
if (IS_ERR(host->data_va))
return PTR_ERR(host->data_va);

host->data_pa = (dma_addr_t)res->start;

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_addr");
host->addr_va = devm_ioremap_resource(&pdev->dev, res);
host->addr_va = devm_platform_ioremap_resource_byname(pdev, "nand_addr");
if (IS_ERR(host->addr_va))
return PTR_ERR(host->addr_va);

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd");
host->cmd_va = devm_ioremap_resource(&pdev->dev, res);
host->cmd_va = devm_platform_ioremap_resource_byname(pdev, "nand_cmd");
if (IS_ERR(host->cmd_va))
return PTR_ERR(host->cmd_va);

res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fsmc_regs");
base = devm_ioremap_resource(&pdev->dev, res);
base = devm_platform_ioremap_resource_byname(pdev, "fsmc_regs");
if (IS_ERR(base))
return PTR_ERR(base);

Expand Down

0 comments on commit 21cf772

Please sign in to comment.