[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: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Thierry Reding 2013-01-21 06:09:07 -03:00 committed by Mauro Carvalho Chehab
parent 7b34be71db
commit f23999eccb
10 changed files with 33 additions and 49 deletions

View File

@ -1099,11 +1099,9 @@ static int gsc_probe(struct platform_device *pdev)
gsc->clock = ERR_PTR(-EINVAL);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
gsc->regs = devm_request_and_ioremap(dev, res);
if (!gsc->regs) {
dev_err(dev, "failed to map registers\n");
return -ENOENT;
}
gsc->regs = devm_ioremap_resource(dev, res);
if (IS_ERR(gsc->regs))
return PTR_ERR(gsc->regs);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!res) {

View File

@ -941,9 +941,9 @@ static int emmaprp_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pcdev);
pcdev->base_emma = devm_request_and_ioremap(&pdev->dev, res_emma);
if (!pcdev->base_emma) {
ret = -ENXIO;
pcdev->base_emma = devm_ioremap_resource(&pdev->dev, res_emma);
if (IS_ERR(pcdev->base_emma)) {
ret = PTR_ERR(pcdev->base_emma);
goto rel_vdev;
}

View File

@ -434,11 +434,9 @@ static int s3c_camif_probe(struct platform_device *pdev)
mres = platform_get_resource(pdev, IORESOURCE_MEM, 0);
camif->io_base = devm_request_and_ioremap(dev, mres);
if (!camif->io_base) {
dev_err(dev, "failed to obtain I/O memory\n");
return -ENOENT;
}
camif->io_base = devm_ioremap_resource(dev, mres);
if (IS_ERR(camif->io_base))
return PTR_ERR(camif->io_base);
ret = camif_request_irqs(pdev, camif);
if (ret < 0)

View File

@ -893,11 +893,9 @@ static int fimc_probe(struct platform_device *pdev)
mutex_init(&fimc->lock);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
fimc->regs = devm_request_and_ioremap(&pdev->dev, res);
if (fimc->regs == NULL) {
dev_err(&pdev->dev, "Failed to obtain io memory\n");
return -ENOENT;
}
fimc->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(fimc->regs))
return PTR_ERR(fimc->regs);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) {

View File

@ -1500,11 +1500,9 @@ static int fimc_lite_probe(struct platform_device *pdev)
mutex_init(&fimc->lock);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
fimc->regs = devm_request_and_ioremap(&pdev->dev, res);
if (fimc->regs == NULL) {
dev_err(&pdev->dev, "Failed to obtain io memory\n");
return -ENOENT;
}
fimc->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(fimc->regs))
return PTR_ERR(fimc->regs);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) {

View File

@ -733,11 +733,9 @@ static int s5pcsis_probe(struct platform_device *pdev)
}
mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
state->regs = devm_request_and_ioremap(&pdev->dev, mem_res);
if (state->regs == NULL) {
dev_err(&pdev->dev, "Failed to request and remap io memory\n");
return -ENXIO;
}
state->regs = devm_ioremap_resource(&pdev->dev, mem_res);
if (IS_ERR(state->regs))
return PTR_ERR(state->regs);
state->irq = platform_get_irq(pdev, 0);
if (state->irq < 0) {

View File

@ -713,11 +713,9 @@ static int g2d_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dev->regs = devm_request_and_ioremap(&pdev->dev, res);
if (dev->regs == NULL) {
dev_err(&pdev->dev, "Failed to obtain io memory\n");
return -ENOENT;
}
dev->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dev->regs))
return PTR_ERR(dev->regs);
dev->clk = clk_get(&pdev->dev, "sclk_fimg2d");
if (IS_ERR(dev->clk)) {

View File

@ -1325,11 +1325,9 @@ static int s5p_jpeg_probe(struct platform_device *pdev)
/* memory-mapped registers */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
jpeg->regs = devm_request_and_ioremap(&pdev->dev, res);
if (jpeg->regs == NULL) {
dev_err(&pdev->dev, "Failed to obtain io memory\n");
return -ENOENT;
}
jpeg->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(jpeg->regs))
return PTR_ERR(jpeg->regs);
/* interrupt service routine registration */
jpeg->irq = ret = platform_get_irq(pdev, 0);

View File

@ -1087,11 +1087,9 @@ static int s5p_mfc_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dev->regs_base = devm_request_and_ioremap(&pdev->dev, res);
if (dev->regs_base == NULL) {
dev_err(&pdev->dev, "Failed to obtain io memory\n");
return -ENOENT;
}
dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(dev->regs_base))
return PTR_ERR(dev->regs_base);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) {

View File

@ -1444,9 +1444,9 @@ static int mx27_camera_emma_init(struct platform_device *pdev)
goto out;
}
pcdev->base_emma = devm_request_and_ioremap(pcdev->dev, res_emma);
if (!pcdev->base_emma) {
err = -EADDRNOTAVAIL;
pcdev->base_emma = devm_ioremap_resource(pcdev->dev, res_emma);
if (IS_ERR(pcdev->base_emma)) {
err = PTR_ERR(pcdev->base_emma);
goto out;
}
@ -1547,9 +1547,9 @@ static int mx2_camera_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&pcdev->discard);
spin_lock_init(&pcdev->lock);
pcdev->base_csi = devm_request_and_ioremap(&pdev->dev, res_csi);
if (!pcdev->base_csi) {
err = -EADDRNOTAVAIL;
pcdev->base_csi = devm_ioremap_resource(&pdev->dev, res_csi);
if (IS_ERR(pcdev->base_csi)) {
err = PTR_ERR(pcdev->base_csi);
goto exit;
}