提交 f23999ec 编写于 作者: T Thierry Reding 提交者: Mauro Carvalho Chehab

[media] media: 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: NThierry Reding <thierry.reding@avionic-design.de>
Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 7b34be71
...@@ -1099,11 +1099,9 @@ static int gsc_probe(struct platform_device *pdev) ...@@ -1099,11 +1099,9 @@ static int gsc_probe(struct platform_device *pdev)
gsc->clock = ERR_PTR(-EINVAL); gsc->clock = ERR_PTR(-EINVAL);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
gsc->regs = devm_request_and_ioremap(dev, res); gsc->regs = devm_ioremap_resource(dev, res);
if (!gsc->regs) { if (IS_ERR(gsc->regs))
dev_err(dev, "failed to map registers\n"); return PTR_ERR(gsc->regs);
return -ENOENT;
}
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) { if (!res) {
......
...@@ -941,9 +941,9 @@ static int emmaprp_probe(struct platform_device *pdev) ...@@ -941,9 +941,9 @@ static int emmaprp_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pcdev); platform_set_drvdata(pdev, pcdev);
pcdev->base_emma = devm_request_and_ioremap(&pdev->dev, res_emma); pcdev->base_emma = devm_ioremap_resource(&pdev->dev, res_emma);
if (!pcdev->base_emma) { if (IS_ERR(pcdev->base_emma)) {
ret = -ENXIO; ret = PTR_ERR(pcdev->base_emma);
goto rel_vdev; goto rel_vdev;
} }
......
...@@ -434,11 +434,9 @@ static int s3c_camif_probe(struct platform_device *pdev) ...@@ -434,11 +434,9 @@ static int s3c_camif_probe(struct platform_device *pdev)
mres = platform_get_resource(pdev, IORESOURCE_MEM, 0); mres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
camif->io_base = devm_request_and_ioremap(dev, mres); camif->io_base = devm_ioremap_resource(dev, mres);
if (!camif->io_base) { if (IS_ERR(camif->io_base))
dev_err(dev, "failed to obtain I/O memory\n"); return PTR_ERR(camif->io_base);
return -ENOENT;
}
ret = camif_request_irqs(pdev, camif); ret = camif_request_irqs(pdev, camif);
if (ret < 0) if (ret < 0)
......
...@@ -893,11 +893,9 @@ static int fimc_probe(struct platform_device *pdev) ...@@ -893,11 +893,9 @@ static int fimc_probe(struct platform_device *pdev)
mutex_init(&fimc->lock); mutex_init(&fimc->lock);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
fimc->regs = devm_request_and_ioremap(&pdev->dev, res); fimc->regs = devm_ioremap_resource(&pdev->dev, res);
if (fimc->regs == NULL) { if (IS_ERR(fimc->regs))
dev_err(&pdev->dev, "Failed to obtain io memory\n"); return PTR_ERR(fimc->regs);
return -ENOENT;
}
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) { if (res == NULL) {
......
...@@ -1500,11 +1500,9 @@ static int fimc_lite_probe(struct platform_device *pdev) ...@@ -1500,11 +1500,9 @@ static int fimc_lite_probe(struct platform_device *pdev)
mutex_init(&fimc->lock); mutex_init(&fimc->lock);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
fimc->regs = devm_request_and_ioremap(&pdev->dev, res); fimc->regs = devm_ioremap_resource(&pdev->dev, res);
if (fimc->regs == NULL) { if (IS_ERR(fimc->regs))
dev_err(&pdev->dev, "Failed to obtain io memory\n"); return PTR_ERR(fimc->regs);
return -ENOENT;
}
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) { if (res == NULL) {
......
...@@ -733,11 +733,9 @@ static int s5pcsis_probe(struct platform_device *pdev) ...@@ -733,11 +733,9 @@ static int s5pcsis_probe(struct platform_device *pdev)
} }
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
state->regs = devm_request_and_ioremap(&pdev->dev, mem_res); state->regs = devm_ioremap_resource(&pdev->dev, mem_res);
if (state->regs == NULL) { if (IS_ERR(state->regs))
dev_err(&pdev->dev, "Failed to request and remap io memory\n"); return PTR_ERR(state->regs);
return -ENXIO;
}
state->irq = platform_get_irq(pdev, 0); state->irq = platform_get_irq(pdev, 0);
if (state->irq < 0) { if (state->irq < 0) {
......
...@@ -713,11 +713,9 @@ static int g2d_probe(struct platform_device *pdev) ...@@ -713,11 +713,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);
dev->regs = devm_request_and_ioremap(&pdev->dev, res); dev->regs = devm_ioremap_resource(&pdev->dev, res);
if (dev->regs == NULL) { if (IS_ERR(dev->regs))
dev_err(&pdev->dev, "Failed to obtain io memory\n"); return PTR_ERR(dev->regs);
return -ENOENT;
}
dev->clk = clk_get(&pdev->dev, "sclk_fimg2d"); dev->clk = clk_get(&pdev->dev, "sclk_fimg2d");
if (IS_ERR(dev->clk)) { if (IS_ERR(dev->clk)) {
......
...@@ -1325,11 +1325,9 @@ static int s5p_jpeg_probe(struct platform_device *pdev) ...@@ -1325,11 +1325,9 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
/* memory-mapped registers */ /* memory-mapped registers */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
jpeg->regs = devm_request_and_ioremap(&pdev->dev, res); jpeg->regs = devm_ioremap_resource(&pdev->dev, res);
if (jpeg->regs == NULL) { if (IS_ERR(jpeg->regs))
dev_err(&pdev->dev, "Failed to obtain io memory\n"); return PTR_ERR(jpeg->regs);
return -ENOENT;
}
/* interrupt service routine registration */ /* interrupt service routine registration */
jpeg->irq = ret = platform_get_irq(pdev, 0); jpeg->irq = ret = platform_get_irq(pdev, 0);
......
...@@ -1087,11 +1087,9 @@ static int s5p_mfc_probe(struct platform_device *pdev) ...@@ -1087,11 +1087,9 @@ static int s5p_mfc_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dev->regs_base = devm_request_and_ioremap(&pdev->dev, res); dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
if (dev->regs_base == NULL) { if (IS_ERR(dev->regs_base))
dev_err(&pdev->dev, "Failed to obtain io memory\n"); return PTR_ERR(dev->regs_base);
return -ENOENT;
}
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) { if (res == NULL) {
......
...@@ -1444,9 +1444,9 @@ static int mx27_camera_emma_init(struct platform_device *pdev) ...@@ -1444,9 +1444,9 @@ static int mx27_camera_emma_init(struct platform_device *pdev)
goto out; goto out;
} }
pcdev->base_emma = devm_request_and_ioremap(pcdev->dev, res_emma); pcdev->base_emma = devm_ioremap_resource(pcdev->dev, res_emma);
if (!pcdev->base_emma) { if (IS_ERR(pcdev->base_emma)) {
err = -EADDRNOTAVAIL; err = PTR_ERR(pcdev->base_emma);
goto out; goto out;
} }
...@@ -1547,9 +1547,9 @@ static int mx2_camera_probe(struct platform_device *pdev) ...@@ -1547,9 +1547,9 @@ static int mx2_camera_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&pcdev->discard); INIT_LIST_HEAD(&pcdev->discard);
spin_lock_init(&pcdev->lock); spin_lock_init(&pcdev->lock);
pcdev->base_csi = devm_request_and_ioremap(&pdev->dev, res_csi); pcdev->base_csi = devm_ioremap_resource(&pdev->dev, res_csi);
if (!pcdev->base_csi) { if (IS_ERR(pcdev->base_csi)) {
err = -EADDRNOTAVAIL; err = PTR_ERR(pcdev->base_csi);
goto exit; goto exit;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册