提交 c2efd3e6 编写于 作者: S Sylwester Nawrocki 提交者: Mauro Carvalho Chehab

[media] V4L: Remove all links of the media entity when unregistering subdev

Remove all links of the subdev's media entity after internal_ops
'unregistered' call and right before unregistering the entity from
a media device.
It is assumed here that an unregistered (orphan) media entity cannot
have links to other entities registered to a media device.
It is also assumed the media links should be created/removed with
the media graph's mutex held.
The above implies that the caller of v4l2_device_unregister_subdev()
must not hold the graph's mutex.
Reviewed-by: NAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
Acked-by: NSakari Ailus <sakari.ailus@iki.fi>
Acked-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 7349cec1
......@@ -269,8 +269,10 @@ void v4l2_device_unregister_subdev(struct v4l2_subdev *sd)
sd->v4l2_dev = NULL;
#if defined(CONFIG_MEDIA_CONTROLLER)
if (v4l2_dev->mdev)
if (v4l2_dev->mdev) {
media_entity_remove_links(&sd->entity);
media_device_unregister_entity(&sd->entity);
}
#endif
video_unregister_device(sd->devnode);
module_put(sd->owner);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册