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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxxxxxxxxx>

Attachment: pgp0FxLG3mNa4.pgp
Description: PGP signature


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux