linux/drivers/media/common
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
..
b2c2 [media] b2c2: Add option to skip the first 6 pid filters 2015-06-09 20:57:56 -03:00
saa7146 [media] include/media: move driver interface headers to a separate dir 2015-11-17 06:57:29 -02:00
siano [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
btcx-risc.h [media] media: remove emacs editor variables 2014-12-22 17:52:20 -02:00
cx2341x.c [media] include/media: move driver interface headers to a separate dir 2015-11-17 06:57:29 -02:00
cypress_firmware.c [media] media: move dvb-usb-v2/cypress_firmware.c to media/common 2013-03-29 11:35:06 -03:00
cypress_firmware.h [media] media: move dvb-usb-v2/cypress_firmware.c to media/common 2013-03-29 11:35:06 -03:00
Kconfig [media] btcx-risc: move to bt8xx 2014-12-23 10:13:19 -02:00
Makefile [media] btcx-risc: move to bt8xx 2014-12-23 10:13:19 -02:00
tveeprom.c [media] tveeprom: Update list of chips and extend serial number to 32bits 2014-11-03 16:18:49 -02:00