Message ID | 1362384921-7344-2-git-send-email-sachin.kamat@linaro.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
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 --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;
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(-)