Commit d5b6dcc4 authored by Laurent Pinchart's avatar Laurent Pinchart

drm/rcar-du: Use devm_ioremap_resource()

Replace the devm_request_mem_region() and devm_ioremap_nocache() calls
with devm_ioremap_resource().
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
parent 6811b1be
...@@ -107,7 +107,6 @@ static int rcar_du_load(struct drm_device *dev, unsigned long flags) ...@@ -107,7 +107,6 @@ static int rcar_du_load(struct drm_device *dev, unsigned long flags)
struct platform_device *pdev = dev->platformdev; struct platform_device *pdev = dev->platformdev;
struct rcar_du_platform_data *pdata = pdev->dev.platform_data; struct rcar_du_platform_data *pdata = pdev->dev.platform_data;
struct rcar_du_device *rcdu; struct rcar_du_device *rcdu;
struct resource *ioarea;
struct resource *mem; struct resource *mem;
int ret; int ret;
...@@ -129,24 +128,9 @@ static int rcar_du_load(struct drm_device *dev, unsigned long flags) ...@@ -129,24 +128,9 @@ static int rcar_du_load(struct drm_device *dev, unsigned long flags)
/* I/O resources and clocks */ /* I/O resources and clocks */
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (mem == NULL) { rcdu->mmio = devm_ioremap_resource(&pdev->dev, mem);
dev_err(&pdev->dev, "failed to get memory resource\n"); if (IS_ERR(rcdu->mmio))
return -EINVAL; return PTR_ERR(rcdu->mmio);
}
ioarea = devm_request_mem_region(&pdev->dev, mem->start,
resource_size(mem), pdev->name);
if (ioarea == NULL) {
dev_err(&pdev->dev, "failed to request memory region\n");
return -EBUSY;
}
rcdu->mmio = devm_ioremap_nocache(&pdev->dev, ioarea->start,
resource_size(ioarea));
if (rcdu->mmio == NULL) {
dev_err(&pdev->dev, "failed to remap memory resource\n");
return -ENOMEM;
}
rcdu->clock = devm_clk_get(&pdev->dev, NULL); rcdu->clock = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(rcdu->clock)) { if (IS_ERR(rcdu->clock)) {
......
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