From: Yangtao Li <frank.li@vivo.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Yangtao Li <frank.li@vivo.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 11/11] media: sh_vou: Convert to devm_platform_ioremap_resource()
Date: Thu, 6 Jul 2023 18:10:59 +0800 [thread overview]
Message-ID: <20230706101100.75654-11-frank.li@vivo.com> (raw)
In-Reply-To: <20230706101100.75654-1-frank.li@vivo.com>
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/media/platform/renesas/sh_vou.c | 12 ++++++------
1 file 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);
--
2.39.0
prev parent reply other threads:[~2023-07-06 10:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-06 10:10 [PATCH 01/11] media: atmel-isi: " Yangtao Li
2023-07-06 10:10 ` [PATCH 02/11] media: pxa_camera: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06 10:10 ` [PATCH 03/11] media: marvell: " Yangtao Li
2023-07-06 10:10 ` [PATCH 04/11] media: microchip-sama5d2-isc: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06 10:10 ` [PATCH 05/11] media: fimc-lite: " Yangtao Li
2023-07-06 10:10 ` [PATCH 06/11] media: microchip-sama7g5-isc: " Yangtao Li
2023-07-06 10:10 ` [PATCH 07/11] media: verisilicon: Convert to devm_platform_ioremap_resource() and devm_platform_ioremap_resource_byname() Yangtao Li
2023-07-07 8:26 ` Chen-Yu Tsai
2023-07-06 10:10 ` [PATCH 08/11] media: stm32-dcmi: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-06 10:10 ` [PATCH 09/11] media: platform: ti: " Yangtao Li
2023-07-07 8:37 ` Laurent Pinchart
2023-07-06 10:10 ` [PATCH 10/11] media: fimc-core: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-06 10:10 ` Yangtao Li [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230706101100.75654-11-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®