diff options
author | Yangtao Li <frank.li@vivo.com> | 2023-07-06 12:10:59 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-07-19 12:57:50 +0200 |
commit | 1f62bf4fb835aca6ca9aba977be9c50f7acf7be4 (patch) | |
tree | b56cf236de8a8ff16e24935404bc0a3b902d593d /drivers/media/platform/renesas | |
parent | media: fimc-core: Convert to devm_platform_ioremap_resource() (diff) | |
download | linux-1f62bf4fb835aca6ca9aba977be9c50f7acf7be4.tar.xz linux-1f62bf4fb835aca6ca9aba977be9c50f7acf7be4.zip |
media: sh_vou: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/platform/renesas')
-rw-r--r-- | drivers/media/platform/renesas/sh_vou.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/platform/renesas/sh_vou.c b/drivers/media/platform/renesas/sh_vou.c index 8fe3272a541f..f792aedc9d82 100644 --- a/drivers/media/platform/renesas/sh_vou.c +++ b/drivers/media/platform/renesas/sh_vou.c @@ -1223,19 +1223,19 @@ static int sh_vou_probe(struct platform_device *pdev) struct i2c_adapter *i2c_adap; struct video_device *vdev; struct sh_vou_device *vou_dev; - struct resource *reg_res; struct v4l2_subdev *subdev; struct vb2_queue *q; int irq, ret; - reg_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - irq = platform_get_irq(pdev, 0); - - if (!vou_pdata || !reg_res || irq <= 0) { + if (!vou_pdata) { dev_err(&pdev->dev, "Insufficient VOU platform information.\n"); return -ENODEV; } + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; + vou_dev = devm_kzalloc(&pdev->dev, sizeof(*vou_dev), GFP_KERNEL); if (!vou_dev) return -ENOMEM; @@ -1264,7 +1264,7 @@ static int sh_vou_probe(struct platform_device *pdev) pix->sizeimage = VOU_MAX_IMAGE_WIDTH * 2 * 480; pix->colorspace = V4L2_COLORSPACE_SMPTE170M; - vou_dev->base = devm_ioremap_resource(&pdev->dev, reg_res); + vou_dev->base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(vou_dev->base)) return PTR_ERR(vou_dev->base); |