[media] V4L: Remove all links of the media entity when unregistering subdev
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Thu, 9 May 2013 11:29:33 +0000 (08:29 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:43:00 +0000 (11:43 +0900)
commita6f8c6e7cb82869963bc8f5b0b1f3219f5f6fb7b
tree3a83505527e12af300699a546f18a1d66a532614
parente9a6c5f1e76152bf6c823349eaaca68f46d72fdd
[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: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/v4l2-core/v4l2-device.c