Skip to content

Commit

Permalink
[media] soc_camera/sh_mobile_ceu_camera: Convert to devm_ioremap_reso…
Browse files Browse the repository at this point in the history
…urce()

Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Sachin Kamat authored and Mauro Carvalho Chehab committed Mar 21, 2013
1 parent bff7993 commit 15a0934
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/completion.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>
Expand Down Expand Up @@ -2111,11 +2112,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;
Expand Down

0 comments on commit 15a0934

Please sign in to comment.