Commit d4ed6025 authored by Thierry Reding's avatar Thierry Reding Committed by Greg Kroah-Hartman

drm: Convert to devm_ioremap_resource()

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.
Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7331205a
...@@ -1785,11 +1785,9 @@ static int fimc_probe(struct platform_device *pdev) ...@@ -1785,11 +1785,9 @@ static int fimc_probe(struct platform_device *pdev)
/* resource memory */ /* resource memory */
ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res); ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
if (!ctx->regs) { if (IS_ERR(ctx->regs))
dev_err(dev, "failed to map registers.\n"); return PTR_ERR(ctx->regs);
return -ENXIO;
}
/* resource irq */ /* resource irq */
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
......
...@@ -913,11 +913,9 @@ static int fimd_probe(struct platform_device *pdev) ...@@ -913,11 +913,9 @@ static int fimd_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ctx->regs = devm_request_and_ioremap(&pdev->dev, res); ctx->regs = devm_ioremap_resource(&pdev->dev, res);
if (!ctx->regs) { if (IS_ERR(ctx->regs))
dev_err(dev, "failed to map registers\n"); return PTR_ERR(ctx->regs);
return -ENXIO;
}
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) { if (!res) {
......
...@@ -1136,10 +1136,9 @@ static int g2d_probe(struct platform_device *pdev) ...@@ -1136,10 +1136,9 @@ static int g2d_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
g2d->regs = devm_request_and_ioremap(&pdev->dev, res); g2d->regs = devm_ioremap_resource(&pdev->dev, res);
if (!g2d->regs) { if (IS_ERR(g2d->regs)) {
dev_err(dev, "failed to remap I/O memory\n"); ret = PTR_ERR(g2d->regs);
ret = -ENXIO;
goto err_put_clk; goto err_put_clk;
} }
......
...@@ -1692,11 +1692,9 @@ static int gsc_probe(struct platform_device *pdev) ...@@ -1692,11 +1692,9 @@ static int gsc_probe(struct platform_device *pdev)
/* resource memory */ /* resource memory */
ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
ctx->regs = devm_request_and_ioremap(dev, ctx->regs_res); ctx->regs = devm_ioremap_resource(dev, ctx->regs_res);
if (!ctx->regs) { if (IS_ERR(ctx->regs))
dev_err(dev, "failed to map registers.\n"); return PTR_ERR(ctx->regs);
return -ENXIO;
}
/* resource irq */ /* resource irq */
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
......
...@@ -656,11 +656,9 @@ static int rotator_probe(struct platform_device *pdev) ...@@ -656,11 +656,9 @@ static int rotator_probe(struct platform_device *pdev)
platform_get_device_id(pdev)->driver_data; platform_get_device_id(pdev)->driver_data;
rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); rot->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
rot->regs = devm_request_and_ioremap(dev, rot->regs_res); rot->regs = devm_ioremap_resource(dev, rot->regs_res);
if (!rot->regs) { if (IS_ERR(rot->regs))
dev_err(dev, "failed to map register\n"); return PTR_ERR(rot->regs);
return -ENXIO;
}
rot->irq = platform_get_irq(pdev, 0); rot->irq = platform_get_irq(pdev, 0);
if (rot->irq < 0) { if (rot->irq < 0) {
......
...@@ -2526,11 +2526,9 @@ static int hdmi_probe(struct platform_device *pdev) ...@@ -2526,11 +2526,9 @@ static int hdmi_probe(struct platform_device *pdev)
return -ENOENT; return -ENOENT;
} }
hdata->regs = devm_request_and_ioremap(&pdev->dev, res); hdata->regs = devm_ioremap_resource(&pdev->dev, res);
if (!hdata->regs) { if (IS_ERR(hdata->regs))
DRM_ERROR("failed to map registers\n"); return PTR_ERR(hdata->regs);
return -ENXIO;
}
ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD"); ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD");
if (ret) { if (ret) {
......
...@@ -764,11 +764,9 @@ static int tegra_dc_probe(struct platform_device *pdev) ...@@ -764,11 +764,9 @@ static int tegra_dc_probe(struct platform_device *pdev)
return -ENXIO; return -ENXIO;
} }
dc->regs = devm_request_and_ioremap(&pdev->dev, regs); dc->regs = devm_ioremap_resource(&pdev->dev, regs);
if (!dc->regs) { if (IS_ERR(dc->regs))
dev_err(&pdev->dev, "failed to remap registers\n"); return PTR_ERR(dc->regs);
return -ENXIO;
}
dc->irq = platform_get_irq(pdev, 0); dc->irq = platform_get_irq(pdev, 0);
if (dc->irq < 0) { if (dc->irq < 0) {
......
...@@ -1259,9 +1259,9 @@ static int tegra_hdmi_probe(struct platform_device *pdev) ...@@ -1259,9 +1259,9 @@ static int tegra_hdmi_probe(struct platform_device *pdev)
if (!regs) if (!regs)
return -ENXIO; return -ENXIO;
hdmi->regs = devm_request_and_ioremap(&pdev->dev, regs); hdmi->regs = devm_ioremap_resource(&pdev->dev, regs);
if (!hdmi->regs) if (IS_ERR(hdmi->regs))
return -EADDRNOTAVAIL; return PTR_ERR(hdmi->regs);
err = platform_get_irq(pdev, 0); err = platform_get_irq(pdev, 0);
if (err < 0) if (err < 0)
......
...@@ -139,9 +139,9 @@ static int tegra_host1x_probe(struct platform_device *pdev) ...@@ -139,9 +139,9 @@ static int tegra_host1x_probe(struct platform_device *pdev)
host1x->irq = err; host1x->irq = err;
host1x->regs = devm_request_and_ioremap(&pdev->dev, regs); host1x->regs = devm_ioremap_resource(&pdev->dev, regs);
if (!host1x->regs) { if (IS_ERR(host1x->regs)) {
err = -EADDRNOTAVAIL; err = PTR_ERR(host1x->regs);
goto err; goto err;
} }
......
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