diff options
author | Fabio Estevam <festevam@gmail.com> | 2019-05-04 10:40:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-05-28 14:17:29 -0400 |
commit | 55be6fd2742ab54a13460c929ac2c40a04ce7d7d (patch) | |
tree | 9cb16010b71b3b89ed35ba244fac7e49fe1ec9e4 | |
parent | 434d40df057c57af57c1d1312a11c0bda1b6923a (diff) |
media: imx7-media-csi: Use devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify the code a bit.
While at it, propagate the real error value in case of
devm_platform_ioremap_resource() failure.
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Rui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/staging/media/imx/imx7-media-csi.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c index c0a626d027fb..2dc27619f25d 100644 --- a/drivers/staging/media/imx/imx7-media-csi.c +++ b/drivers/staging/media/imx/imx7-media-csi.c @@ -1164,7 +1164,6 @@ static int imx7_csi_probe(struct platform_device *pdev) struct device_node *node = dev->of_node; struct imx_media_dev *imxmd; struct imx7_csi *csi; - struct resource *res; int ret; csi = devm_kzalloc(&pdev->dev, sizeof(*csi), GFP_KERNEL); @@ -1180,17 +1179,16 @@ static int imx7_csi_probe(struct platform_device *pdev) return ret; } - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); csi->irq = platform_get_irq(pdev, 0); - if (!res || csi->irq < 0) { + if (csi->irq < 0) { dev_err(dev, "Missing platform resources data\n"); return -ENODEV; } - csi->regbase = devm_ioremap_resource(dev, res); + csi->regbase = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(csi->regbase)) { dev_err(dev, "Failed platform resources map\n"); - return -ENODEV; + return PTR_ERR(csi->regbase); } spin_lock_init(&csi->irqlock); |