Commit b1a9329c authored by Julia Lawall's avatar Julia Lawall Committed by Tomi Valkeinen

video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_resource

Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The initialization of drvdata->regs_phys was manually moved lower, to take
advantage of the NULL test on res performed by devm_ioremap_resource.
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 9c29fba1
...@@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev, ...@@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
struct resource *res; struct resource *res;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
drvdata->regs_phys = res->start; drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
drvdata->regs = devm_request_and_ioremap(&pdev->dev, res); if (IS_ERR(drvdata->regs)) {
if (!drvdata->regs) { rc = PTR_ERR(drvdata->regs);
rc = -EADDRNOTAVAIL;
goto err_region; goto err_region;
} }
drvdata->regs_phys = res->start;
} }
/* Allocate the framebuffer memory */ /* Allocate the framebuffer memory */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment