From b1a9329cd5c4a26cdc2b12015ad055174a09e4ad Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Mon, 19 Aug 2013 13:20:40 +0200 Subject: [PATCH] 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: Julia Lawall Signed-off-by: Tomi Valkeinen --- drivers/video/xilinxfb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c index f3d4a69e1e4e..236fd42370db 100644 --- a/drivers/video/xilinxfb.c +++ b/drivers/video/xilinxfb.c @@ -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 */ -- 2.20.1