bcm2835-unicam: hacks to allow it to build
authorDom Cobley <popcornmix@gmail.com>
Wed, 13 Sep 2023 17:53:21 +0000 (18:53 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:39 +0000 (11:33 +0000)
media: bcm2835-unicam: Fix up async notifier usage

Fixes "8a090fc3e549 bcm2835-unicam: hacks to allow it to build"

drivers/media/platform/bcm2835/bcm2835-unicam.c

index 2fe2817..65f6632 100644 (file)
@@ -527,7 +527,7 @@ struct unicam_device {
        struct kref kref;
 
        /* V4l2 specific parameters */
-       struct v4l2_async_subdev asd;
+       struct v4l2_async_connection *asd;
 
        /* peripheral base address */
        void __iomem *base;
@@ -2802,7 +2802,7 @@ static const struct v4l2_file_operations unicam_fops = {
 static int
 unicam_async_bound(struct v4l2_async_notifier *notifier,
                   struct v4l2_subdev *subdev,
-                  struct v4l2_async_subdev *asd)
+                  struct v4l2_async_connection *asd)
 {
        struct unicam_device *unicam = to_unicam_device(notifier->v4l2_dev);
 
@@ -3335,18 +3335,18 @@ static int of_unicam_connect_subdevs(struct unicam_device *dev)
                   dev->max_data_lanes, dev->bus_flags);
 
        /* Initialize and register the async notifier. */
-       v4l2_async_nf_init(&dev->notifier);
+       v4l2_async_nf_init(&dev->notifier, &dev->v4l2_dev);
        dev->notifier.ops = &unicam_async_ops;
 
-       dev->asd.match_type = V4L2_ASYNC_MATCH_FWNODE;
-       dev->asd.match.fwnode = fwnode_graph_get_remote_endpoint(of_fwnode_handle(ep_node));
-       ret = __v4l2_async_nf_add_subdev(&dev->notifier, &dev->asd);
-       if (ret) {
+       dev->asd = v4l2_async_nf_add_fwnode(&dev->notifier,
+                                           of_fwnode_handle(sensor_node),
+                                           struct v4l2_async_connection);
+       if (IS_ERR(dev->asd)) {
                unicam_err(dev, "Error adding subdevice: %d\n", ret);
                goto cleanup_exit;
        }
 
-       ret = v4l2_async_nf_register(&dev->v4l2_dev, &dev->notifier);
+       ret = v4l2_async_nf_register(&dev->notifier);
        if (ret) {
                unicam_err(dev, "Error registering async notifier: %d\n", ret);
                ret = -EINVAL;