From: Frank Li <Frank.Li@nxp.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Michael Riesch <michael.riesch@collabora.com>,
Maxime Ripard <mripard@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev, Frank Li <Frank.Li@nxp.com>
Subject: [PATCH v2 2/3] media: synopsys: Use media_async_register_subdev() to simplify code
Date: Thu, 26 Feb 2026 17:55:27 -0500 [thread overview]
Message-ID: <20260226-v4l2_init_register-v2-2-902d7140f9fa@nxp.com> (raw)
In-Reply-To: <20260226-v4l2_init_register-v2-0-902d7140f9fa@nxp.com>
Use media_async_register_subdev() to simplify the code.
No functional changes.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/media/platform/synopsys/dw-mipi-csi2rx.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
index 5dc55b59d6aeed4b6cb207c8e2ebe0fb3c462644..1898b3c82efae6a74192bf987876a87848cffb48 100644
--- a/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
+++ b/drivers/media/platform/synopsys/dw-mipi-csi2rx.c
@@ -681,15 +681,8 @@ static int dw_mipi_csi2rx_register(struct dw_mipi_csi2rx_device *csi2)
pads[DW_MIPI_CSI2RX_PAD_SINK].flags = MEDIA_PAD_FL_SINK |
MEDIA_PAD_FL_MUST_CONNECT;
pads[DW_MIPI_CSI2RX_PAD_SRC].flags = MEDIA_PAD_FL_SOURCE;
- ret = media_entity_pads_init(&sd->entity, DW_MIPI_CSI2RX_PAD_MAX, pads);
- if (ret)
- goto err_notifier_unregister;
-
- ret = v4l2_subdev_init_finalize(sd);
- if (ret)
- goto err_entity_cleanup;
- ret = v4l2_async_register_subdev(sd);
+ ret = media_async_register_subdev(sd, DW_MIPI_CSI2RX_PAD_MAX, pads);
if (ret) {
dev_err(sd->dev, "failed to register CSI-2 subdev\n");
goto err_subdev_cleanup;
@@ -698,10 +691,6 @@ static int dw_mipi_csi2rx_register(struct dw_mipi_csi2rx_device *csi2)
return 0;
err_subdev_cleanup:
- v4l2_subdev_cleanup(sd);
-err_entity_cleanup:
- media_entity_cleanup(&sd->entity);
-err_notifier_unregister:
v4l2_async_nf_unregister(&csi2->notifier);
v4l2_async_nf_cleanup(&csi2->notifier);
err:
--
2.43.0
next prev parent reply other threads:[~2026-02-26 22:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 22:55 [PATCH v2 0/3] media: v4l: async: add helper API v4l2_async_pad_init_and_register_subdev() Frank Li
2026-02-26 22:55 ` [PATCH v2 1/3] media: v4l: async: add helper API media_async_register_subdev() Frank Li
2026-03-02 13:21 ` Sakari Ailus
2026-03-02 15:43 ` Frank Li
2026-03-04 22:04 ` Frank Li
2026-02-26 22:55 ` Frank Li [this message]
2026-02-26 22:55 ` [PATCH v2 3/3] media: cadence: cdns-csi2rx: Use media_async_register_subdev() to simplify code Frank Li
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=20260226-v4l2_init_register-v2-2-902d7140f9fa@nxp.com \
--to=frank.li@nxp.com \
--cc=imx@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=michael.riesch@collabora.com \
--cc=mripard@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/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