aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus <[email protected]>2017-07-17 10:04:20 -0400
committerMauro Carvalho Chehab <[email protected]>2017-10-31 13:53:18 -0400
commit24def9b586349ec1ecea7989fc219e688d1d1e74 (patch)
tree427789cf93604d22bf70f458743855ccc746d6df
parentddddc18b219ada692704c5467d16fff8c79cf287 (diff)
media: v4l: async: Register sub-devices before calling bound callback
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 <[email protected]> Acked-by: Hans Verkuil <[email protected]> Acked-by: Pavel Machek <[email protected]> Acked-by: Niklas Söderlund <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
-rw-r--r--drivers/media/v4l2-core/v4l2-async.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index e170682dae78..46db85685894 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;
}