From b8ec754ae4c563f6aab8c0cb47aeb2eae67f1da3 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Thu, 23 Feb 2023 16:24:48 +0100 Subject: media: v4l: async: Set v4l2_device and subdev in async notifier init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set the v4l2_device already in async notifier init, so struct device related to it will be available before the notifier is registered. This requires separating notifier initialisation into two functions, one that takes v4l2_device as its argument, v4l2_async_nf_init and v4l2_async_subdev_nf_init, for sub-device notifiers. Registering the notifier will use a single function, v4l2_async_nf_register. This is done in order to make struct device available earlier, during construction of the async connections, for sensible debug prints. Signed-off-by: Sakari Ailus Tested-by: Philipp Zabel # imx6qp Tested-by: Niklas Söderlund # rcar + adv746x Tested-by: Aishwarya Kothari # Apalis i.MX6Q with TC358743 Tested-by: Lad Prabhakar # Renesas RZ/G2L SMARC Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/microchip/microchip-sama7g5-isc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/media/platform/microchip/microchip-sama7g5-isc.c') diff --git a/drivers/media/platform/microchip/microchip-sama7g5-isc.c b/drivers/media/platform/microchip/microchip-sama7g5-isc.c index cd982a995d72..73445f33d26b 100644 --- a/drivers/media/platform/microchip/microchip-sama7g5-isc.c +++ b/drivers/media/platform/microchip/microchip-sama7g5-isc.c @@ -517,7 +517,7 @@ static int microchip_xisc_probe(struct platform_device *pdev) struct fwnode_handle *fwnode = of_fwnode_handle(subdev_entity->epn); - v4l2_async_nf_init(&subdev_entity->notifier); + v4l2_async_nf_init(&subdev_entity->notifier, &isc->v4l2_dev); asd = v4l2_async_nf_add_fwnode_remote(&subdev_entity->notifier, fwnode, @@ -533,8 +533,7 @@ static int microchip_xisc_probe(struct platform_device *pdev) subdev_entity->notifier.ops = µchip_isc_async_ops; - ret = v4l2_async_nf_register(&isc->v4l2_dev, - &subdev_entity->notifier); + ret = v4l2_async_nf_register(&subdev_entity->notifier); if (ret) { dev_err(dev, "fail to register async notifier\n"); goto cleanup_subdev; -- cgit v1.2.3