Thread (32 messages) 32 messages, 8 authors, 2017-09-21
STALE3210d REVIEWED: 1 (0M)
Revisions (4)
  1. v10 [diff vs current]
  2. v12 [diff vs current]
  3. v13 current
  4. v16 [diff vs current]

[PATCH v13 12/25] v4l: async: Register sub-devices before calling bound callback

From: Sakari Ailus <sakari.ailus@linux.intel.com>
Date: 2017-09-15 14:17:11
Also in: linux-media
Subsystem: media input infrastructure (v4l/dvb), the rest, v4l2 async and fwnode frameworks · Maintainers: Mauro Carvalho Chehab, Linus Torvalds, Sakari Ailus

Register the sub-device before calling the notifier's bound callback.
Doing this the other way around is problematic as the struct v4l2_device
has not assigned for the sub-device yet and may be required by the bound
callback.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Hans Verkuil <redacted>
---
 drivers/media/v4l2-core/v4l2-async.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index c35d04b9122f..9895b610e2a0 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -130,13 +130,13 @@ static int v4l2_async_match_notify(struct v4l2_async_notifier *notifier,
 {
 	int ret;
 
-	ret = v4l2_async_notifier_call_bound(notifier, sd, asd);
+	ret = v4l2_device_register_subdev(notifier->v4l2_dev, sd);
 	if (ret < 0)
 		return ret;
 
-	ret = v4l2_device_register_subdev(notifier->v4l2_dev, sd);
+	ret = v4l2_async_notifier_call_bound(notifier, sd, asd);
 	if (ret < 0) {
-		v4l2_async_notifier_call_unbind(notifier, sd, asd);
+		v4l2_device_unregister_subdev(sd);
 		return ret;
 	}
 
-- 
2.11.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help