linux/drivers/media/platform
Javier Martinez Canillas 9832e155f1 [media] media-device: split media initialization and registration
The media device node is registered and so made visible to user-space
before entities are registered and links created which means that the
media graph obtained by user-space could be only partially enumerated
if that happens too early before all the graph has been created.

To avoid this race condition, split the media init and registration
in separate functions and only register the media device node when
all the pending subdevices have been registered, either explicitly
by the driver or asynchronously using v4l2_async_register_subdev().

The media_device_register() had a check for drivers not filling dev
and model fields but all drivers in mainline set them and not doing
it will be a driver bug so change the function return to void and
add a BUG_ON() for dev being NULL instead.

Also, add a media_device_cleanup() function that will destroy the
graph_mutex that is initialized in media_device_init().

[mchehab@osg.samsung.com: Fix compilation if !CONFIG_MEDIA_CONTROLLER
 and remove two warnings added by this changeset]
Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-01-11 12:19:15 -02:00
..
am437x [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
blackfin [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
coda [media] coda: enable MPEG-2 ES decoding 2015-12-23 14:04:01 -02:00
davinci [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
exynos4-is [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
exynos-gsc [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
marvell-ccic [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
omap [media] v4l: omap_vout: Don't free buffers if they haven't been allocated 2015-11-19 11:15:20 -02:00
omap3isp [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
s3c-camif [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
s5p-g2d [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
s5p-jpeg [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
s5p-mfc [media] s5p-mfc: remove volatile attribute from MFC register addresses 2015-12-23 14:00:22 -02:00
s5p-tv [media] vb2: drop v4l2_format argument from queue_setup 2015-12-18 13:48:19 -02:00
soc_camera [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
sti [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
ti-vpe [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
vivid [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
vsp1 [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
xilinx [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
arv.c [media] media: remove the setting of the flag V4L2_FL_USE_FH_PRIO 2014-07-04 16:14:59 -03:00
fsl-viu.c [media] fsl-viu: drop format names 2015-08-11 06:59:09 -03:00
Kconfig [media] sh-vou: clarify videobuf2 dependency 2015-11-17 14:55:26 -02:00
m2m-deinterlace.c [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
Makefile [media] c8sectpfe: Add Kconfig and Makefile for the driver 2015-08-11 16:08:29 -03:00
mx2_emmaprp.c [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
rcar_jpu.c [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
sh_veu.c [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
sh_vou.c [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
timblogiw.c [media] include/media: move platform_data to linux/platform_data/media 2015-11-17 06:58:42 -02:00
via-camera.c [media] include/media: split I2C headers from V4L2 core 2015-11-17 06:57:11 -02:00
via-camera.h
vim2m.c [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00