diff mbox

[2/4,media] soc_camera/pxa_camera: Convert to devm_ioremap_resource()

Message ID 1362384921-7344-2-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Sachin Kamat March 4, 2013, 8:15 a.m. UTC
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/media/platform/soc_camera/pxa_camera.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Comments

Thierry Reding March 4, 2013, 9:13 a.m. UTC | #1
On Mon, Mar 04, 2013 at 01:45:19PM +0530, Sachin Kamat wrote:
> Use the newly introduced devm_ioremap_resource() instead of
> devm_request_and_ioremap() which provides more consistent error handling.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/media/platform/soc_camera/pxa_camera.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
> index 395e2e0..42abbce 100644
> --- a/drivers/media/platform/soc_camera/pxa_camera.c
> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
> @@ -15,6 +15,7 @@
>  #include <linux/io.h>
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
> +#include <linux/err.h>
>  #include <linux/errno.h>
>  #include <linux/fs.h>
>  #include <linux/interrupt.h>
> @@ -1710,9 +1711,10 @@ 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;
>  

Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
diff mbox

Patch

diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
index 395e2e0..42abbce 100644
--- a/drivers/media/platform/soc_camera/pxa_camera.c
+++ b/drivers/media/platform/soc_camera/pxa_camera.c
@@ -15,6 +15,7 @@ 
 #include <linux/io.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
+#include <linux/err.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/interrupt.h>
@@ -1710,9 +1711,10 @@  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;