提交 24def9b5 编写于 作者: S Sakari Ailus 提交者: Mauro Carvalho Chehab

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: NSakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: NHans Verkuil <hans.verkuil@cisco.com>
Acked-by: NPavel Machek <pavel@ucw.cz>
Acked-by: NNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: NSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 ddddc18b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册