aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus <[email protected]>2023-05-19 13:56:33 +0200
committerMauro Carvalho Chehab <[email protected]>2023-07-28 10:35:38 +0200
commit026e6212ec8ba1b4b4bab68a6cce2a164ee6774a (patch)
treea52a433f3d676b5c08a6fb778d778eaf3d5f6a04
parent645858055d6a52d06ccc0efd7197a39b22c90a8f (diff)
media: omap3isp: Move link creation to bound callback
Move the creation of the links between external sub-devices and ISP sub-devices to the bound callback. This way we can also remove the need to access the sub-device's notifier field that will soon be removed. Signed-off-by: Sakari Ailus <[email protected]> Tested-by: Philipp Zabel <[email protected]> # imx6qp Tested-by: Niklas Söderlund <[email protected]> # rcar + adv746x Tested-by: Aishwarya Kothari <[email protected]> # Apalis i.MX6Q with TC358743 Tested-by: Lad Prabhakar <[email protected]> # Renesas RZ/G2L SMARC Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/platform/ti/omap3isp/isp.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/media/platform/ti/omap3isp/isp.c b/drivers/media/platform/ti/omap3isp/isp.c
index 2f9c7d688a1c..b01d70dbd0c4 100644
--- a/drivers/media/platform/ti/omap3isp/isp.c
+++ b/drivers/media/platform/ti/omap3isp/isp.c
@@ -2022,35 +2022,34 @@ enum isp_of_phy {
ISP_OF_PHY_CSIPHY2,
};
-static int isp_subdev_notifier_complete(struct v4l2_async_notifier *async)
+static int isp_subdev_notifier_bound(struct v4l2_async_notifier *async,
+ struct v4l2_subdev *sd,
+ struct v4l2_async_subdev *asd)
{
struct isp_device *isp = container_of(async, struct isp_device,
notifier);
- struct v4l2_device *v4l2_dev = &isp->v4l2_dev;
- struct v4l2_subdev *sd;
+ struct isp_bus_cfg *bus_cfg =
+ &container_of(asd, struct isp_async_subdev, asd)->bus;
int ret;
mutex_lock(&isp->media_dev.graph_mutex);
+ ret = isp_link_entity(isp, &sd->entity, bus_cfg->interface);
+ mutex_unlock(&isp->media_dev.graph_mutex);
- ret = media_entity_enum_init(&isp->crashed, &isp->media_dev);
- if (ret) {
- mutex_unlock(&isp->media_dev.graph_mutex);
- return ret;
- }
-
- list_for_each_entry(sd, &v4l2_dev->subdevs, list) {
- if (sd->notifier != &isp->notifier)
- continue;
+ return ret;
+}
- ret = isp_link_entity(isp, &sd->entity,
- v4l2_subdev_to_bus_cfg(sd)->interface);
- if (ret < 0) {
- mutex_unlock(&isp->media_dev.graph_mutex);
- return ret;
- }
- }
+static int isp_subdev_notifier_complete(struct v4l2_async_notifier *async)
+{
+ struct isp_device *isp = container_of(async, struct isp_device,
+ notifier);
+ int ret;
+ mutex_lock(&isp->media_dev.graph_mutex);
+ ret = media_entity_enum_init(&isp->crashed, &isp->media_dev);
mutex_unlock(&isp->media_dev.graph_mutex);
+ if (ret)
+ return ret;
ret = v4l2_device_register_subdev_nodes(&isp->v4l2_dev);
if (ret < 0)
@@ -2240,6 +2239,7 @@ static int isp_parse_of_endpoints(struct isp_device *isp)
}
static const struct v4l2_async_notifier_operations isp_subdev_notifier_ops = {
+ .bound = isp_subdev_notifier_bound,
.complete = isp_subdev_notifier_complete,
};