Re: [PATCH 14/33] media: Convert to devm_ioremap_resource()

2013-01-22 Thread Sylwester Nawrocki
Hi,

On 01/21/2013 11:09 AM, Thierry Reding wrote:
> 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 
> Cc: Mauro Carvalho Chehab 
> Cc: linux-media@vger.kernel.org
> ---
>  drivers/media/platform/exynos-gsc/gsc-core.c   |  8 +++-
>  drivers/media/platform/mx2_emmaprp.c   |  6 +++---
>  drivers/media/platform/s3c-camif/camif-core.c  |  8 +++-
>  drivers/media/platform/s5p-fimc/fimc-core.c|  8 +++-
>  drivers/media/platform/s5p-fimc/fimc-lite.c|  8 +++-
>  drivers/media/platform/s5p-fimc/mipi-csis.c|  8 +++-
>  drivers/media/platform/s5p-g2d/g2d.c   |  8 +++-
>  drivers/media/platform/s5p-jpeg/jpeg-core.c|  8 +++-
>  drivers/media/platform/s5p-mfc/s5p_mfc.c   |  8 +++-
>  drivers/media/platform/soc_camera/mx2_camera.c | 12 ++--
>  10 files changed, 33 insertions(+), 49 deletions(-)

That's a nice cleanup. For exynos-gsc, s3c-camif, s5p-* drivers

Acked-by: Sylwester Nawrocki 

--

Thanks,
Sylwester
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 14/33] media: Convert to devm_ioremap_resource()

2013-01-21 Thread Thierry Reding
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 
Cc: Mauro Carvalho Chehab 
Cc: linux-media@vger.kernel.org
---
 drivers/media/platform/exynos-gsc/gsc-core.c   |  8 +++-
 drivers/media/platform/mx2_emmaprp.c   |  6 +++---
 drivers/media/platform/s3c-camif/camif-core.c  |  8 +++-
 drivers/media/platform/s5p-fimc/fimc-core.c|  8 +++-
 drivers/media/platform/s5p-fimc/fimc-lite.c|  8 +++-
 drivers/media/platform/s5p-fimc/mipi-csis.c|  8 +++-
 drivers/media/platform/s5p-g2d/g2d.c   |  8 +++-
 drivers/media/platform/s5p-jpeg/jpeg-core.c|  8 +++-
 drivers/media/platform/s5p-mfc/s5p_mfc.c   |  8 +++-
 drivers/media/platform/soc_camera/mx2_camera.c | 12 ++--
 10 files changed, 33 insertions(+), 49 deletions(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c 
b/drivers/media/platform/exynos-gsc/gsc-core.c
index 2b1b9f3..c1a0713 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -1098,11 +1098,9 @@ static int gsc_probe(struct platform_device *pdev)
mutex_init(&gsc->lock);
 
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) {
diff --git a/drivers/media/platform/mx2_emmaprp.c 
b/drivers/media/platform/mx2_emmaprp.c
index 6b155d7..4b9e0a2 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -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;
}
 
diff --git a/drivers/media/platform/s3c-camif/camif-core.c 
b/drivers/media/platform/s3c-camif/camif-core.c
index e2716c3..09a8c9c 100644
--- a/drivers/media/platform/s3c-camif/camif-core.c
+++ b/drivers/media/platform/s3c-camif/camif-core.c
@@ -433,11 +433,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)
diff --git a/drivers/media/platform/s5p-fimc/fimc-core.c 
b/drivers/media/platform/s5p-fimc/fimc-core.c
index 545b46a..acc0f84 100644
--- a/drivers/media/platform/s5p-fimc/fimc-core.c
+++ b/drivers/media/platform/s5p-fimc/fimc-core.c
@@ -909,11 +909,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) {
diff --git a/drivers/media/platform/s5p-fimc/fimc-lite.c 
b/drivers/media/platform/s5p-fimc/fimc-lite.c
index ed67220..67db9f8 100644
--- a/drivers/media/platform/s5p-fimc/fimc-lite.c
+++ b/drivers/media/platform/s5p-fimc/fimc-lite.c
@@ -1426,11 +1426,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 == NUL