Skip to content

Commit

Permalink
mtd: plat-ram: Use devm_platform_get_and_ioremap_resource()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
  • Loading branch information
bbkzz authored and miquelraynal committed Jul 12, 2023
1 parent 79c4a56 commit 0e0d59f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/mtd/maps/plat-ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ static int platram_probe(struct platform_device *pdev)
info->pdata = pdata;

/* get the resource for the memory mapping */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
info->map.virt = devm_ioremap_resource(&pdev->dev, res);
info->map.virt = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(info->map.virt)) {
err = PTR_ERR(info->map.virt);
goto exit_free;
Expand Down

0 comments on commit 0e0d59f

Please sign in to comment.