Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] soc_camera: convert to devm_ioremap_resource()
@ 2013-03-11  7:40 Silviu-Mihai Popescu
  2013-03-11  7:50 ` Guennadi Liakhovetski
  0 siblings, 1 reply; 4+ messages in thread
From: Silviu-Mihai Popescu @ 2013-03-11  7:40 UTC (permalink / raw)
  To: linux-media; +Cc: g.liakhovetski, mchehab, linux-kernel, Silviu-Mihai Popescu

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: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>
---
 drivers/media/platform/soc_camera/pxa_camera.c     |    6 +++---
 .../platform/soc_camera/sh_mobile_ceu_camera.c     |    8 +++-----
 drivers/media/platform/soc_camera/sh_mobile_csi2.c |    8 +++-----
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
index 395e2e0..e94ed6c 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -1710,9 +1710,9 @@ static int pxa_camera_probe(struct platform_device *pdev)
 	/*
 	 * Request the regions.
 	 */
-	base = devm_request_and_ioremap(&pdev->dev, res);
-	if (!base)
-		return -ENOMEM;
+	base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
 	pcdev->irq = irq;
 	pcdev->base = base;
 
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index bb08a46..8cdee71 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -2110,11 +2110,9 @@ static int sh_mobile_ceu_probe(struct platform_device *pdev)
 	pcdev->max_width = pcdev->pdata->max_width ? : 2560;
 	pcdev->max_height = pcdev->pdata->max_height ? : 1920;
 
-	base = devm_request_and_ioremap(&pdev->dev, res);
-	if (!base) {
-		dev_err(&pdev->dev, "Unable to ioremap CEU registers.\n");
-		return -ENXIO;
-	}
+	base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
 
 	pcdev->irq = irq;
 	pcdev->base = base;
diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
index 42c559e..3ec7735 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
@@ -324,11 +324,9 @@ static int sh_csi2_probe(struct platform_device *pdev)
 
 	priv->irq = irq;
 
-	priv->base = devm_request_and_ioremap(&pdev->dev, res);
-	if (!priv->base) {
-		dev_err(&pdev->dev, "Unable to ioremap CSI2 registers.\n");
-		return -ENXIO;
-	}
+	priv->base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(priv->base))
+		return PTR_ERR(priv->base);
 
 	priv->pdev = pdev;
 	platform_set_drvdata(pdev, priv);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] soc_camera: convert to devm_ioremap_resource()
  2013-03-11  7:40 [PATCH] soc_camera: convert to devm_ioremap_resource() Silviu-Mihai Popescu
@ 2013-03-11  7:50 ` Guennadi Liakhovetski
  2013-03-11  7:58   ` Silviu Popescu
  0 siblings, 1 reply; 4+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-11  7:50 UTC (permalink / raw)
  To: Silviu-Mihai Popescu; +Cc: linux-media, mchehab, linux-kernel

Hi Silviu-Mihai

On Mon, 11 Mar 2013, Silviu-Mihai Popescu 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: Silviu-Mihai Popescu <silviupopescu1990@gmail.com>

Is there anything in this patch, that this patch series

http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/61337

is missing?

Thanks
Guennadi

> ---
>  drivers/media/platform/soc_camera/pxa_camera.c     |    6 +++---
>  .../platform/soc_camera/sh_mobile_ceu_camera.c     |    8 +++-----
>  drivers/media/platform/soc_camera/sh_mobile_csi2.c |    8 +++-----
>  3 files changed, 9 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
> index 395e2e0..e94ed6c 100644
> --- a/drivers/media/platform/soc_camera/pxa_camera.c
> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
> @@ -1710,9 +1710,9 @@ static int pxa_camera_probe(struct platform_device *pdev)
>  	/*
>  	 * Request the regions.
>  	 */
> -	base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!base)
> -		return -ENOMEM;
> +	base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
>  	pcdev->irq = irq;
>  	pcdev->base = base;
>  
> diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
> index bb08a46..8cdee71 100644
> --- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
> +++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
> @@ -2110,11 +2110,9 @@ static int sh_mobile_ceu_probe(struct platform_device *pdev)
>  	pcdev->max_width = pcdev->pdata->max_width ? : 2560;
>  	pcdev->max_height = pcdev->pdata->max_height ? : 1920;
>  
> -	base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!base) {
> -		dev_err(&pdev->dev, "Unable to ioremap CEU registers.\n");
> -		return -ENXIO;
> -	}
> +	base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(base))
> +		return PTR_ERR(base);
>  
>  	pcdev->irq = irq;
>  	pcdev->base = base;
> diff --git a/drivers/media/platform/soc_camera/sh_mobile_csi2.c b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
> index 42c559e..3ec7735 100644
> --- a/drivers/media/platform/soc_camera/sh_mobile_csi2.c
> +++ b/drivers/media/platform/soc_camera/sh_mobile_csi2.c
> @@ -324,11 +324,9 @@ static int sh_csi2_probe(struct platform_device *pdev)
>  
>  	priv->irq = irq;
>  
> -	priv->base = devm_request_and_ioremap(&pdev->dev, res);
> -	if (!priv->base) {
> -		dev_err(&pdev->dev, "Unable to ioremap CSI2 registers.\n");
> -		return -ENXIO;
> -	}
> +	priv->base = devm_ioremap_resource(&pdev->dev, res);
> +	if (IS_ERR(priv->base))
> +		return PTR_ERR(priv->base);
>  
>  	priv->pdev = pdev;
>  	platform_set_drvdata(pdev, priv);
> -- 
> 1.7.9.5
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] soc_camera: convert to devm_ioremap_resource()
  2013-03-11  7:50 ` Guennadi Liakhovetski
@ 2013-03-11  7:58   ` Silviu Popescu
  2013-03-11  8:03     ` Guennadi Liakhovetski
  0 siblings, 1 reply; 4+ messages in thread
From: Silviu Popescu @ 2013-03-11  7:58 UTC (permalink / raw)
  To: Guennadi Liakhovetski; +Cc: linux-media, mchehab, linux-kernel

On Mon, Mar 11, 2013 at 9:50 AM, Guennadi Liakhovetski
<g.liakhovetski@gmx.de> wrote:
>
> Is there anything in this patch, that this patch series
>
> http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/61337
>
> is missing?
>
> Thanks
> Guennadi

Hello Guennadi,

I seem to have missed that patch series. And no, this does not cover
anything extra.
I'm sorry for the lack of attention on my behalf.

--
Silviu Popescu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] soc_camera: convert to devm_ioremap_resource()
  2013-03-11  7:58   ` Silviu Popescu
@ 2013-03-11  8:03     ` Guennadi Liakhovetski
  0 siblings, 0 replies; 4+ messages in thread
From: Guennadi Liakhovetski @ 2013-03-11  8:03 UTC (permalink / raw)
  To: Silviu Popescu; +Cc: linux-media, mchehab, linux-kernel

On Mon, 11 Mar 2013, Silviu Popescu wrote:

> On Mon, Mar 11, 2013 at 9:50 AM, Guennadi Liakhovetski
> <g.liakhovetski@gmx.de> wrote:
> >
> > Is there anything in this patch, that this patch series
> >
> > http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/61337
> >
> > is missing?
> >
> > Thanks
> > Guennadi
> 
> Hello Guennadi,
> 
> I seem to have missed that patch series. And no, this does not cover
> anything extra.

Good, thanks for checking!

> I'm sorry for the lack of attention on my behalf.

No problem, it's hard to follow all incoming changes.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-03-11  8:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11  7:40 [PATCH] soc_camera: convert to devm_ioremap_resource() Silviu-Mihai Popescu
2013-03-11  7:50 ` Guennadi Liakhovetski
2013-03-11  7:58   ` Silviu Popescu
2013-03-11  8:03     ` Guennadi Liakhovetski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox