Skip to content

Commit

Permalink
video: xilinxfb: replace devm_request_and_ioremap by devm_ioremap_res…
Browse files Browse the repository at this point in the history
…ource

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: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Julia Lawall authored and Tomi Valkeinen committed Aug 30, 2013
1 parent 9c29fba commit b1a9329
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/video/xilinxfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ static int xilinxfb_assign(struct platform_device *pdev,
struct resource *res;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
drvdata->regs_phys = res->start;
drvdata->regs = devm_request_and_ioremap(&pdev->dev, res);
if (!drvdata->regs) {
rc = -EADDRNOTAVAIL;
drvdata->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(drvdata->regs)) {
rc = PTR_ERR(drvdata->regs);
goto err_region;
}
drvdata->regs_phys = res->start;
}

/* Allocate the framebuffer memory */
Expand Down

0 comments on commit b1a9329

Please sign in to comment.