summaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-6.6/950-0493-bcm2835-unicam-hacks-to-allow-it-to-build.patch
blob: 9fa57e93ea3bad442a4079258daf1604dd5855c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 1cd18f8e3da09c7bd80d2b0f8ebbb66d20d59bbf Mon Sep 17 00:00:00 2001
From: Dom Cobley <popcornmix@gmail.com>
Date: Wed, 13 Sep 2023 18:53:21 +0100
Subject: [PATCH 0493/1085] bcm2835-unicam: hacks to allow it to build

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 | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
@@ -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
 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(str
 		   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;