mtd: plat-ram: Use devm_platform_get_and_ioremap_resource()
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 <frank.li@vivo.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230707040622.78174-13-frank.li@vivo.com
This commit is contained in:
parent
79c4a56250
commit
0e0d59f2f6
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user