linux/drivers/media/usb
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
..
airspy [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
as102 [media] as102: fix potential double free in as102_fw_upload() 2015-11-19 09:16:10 -02:00
au0828 [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
b2c2 [media] drivers: media: usb: b2c2: use usb_*_coherent() instead of pci_*_consistent() in flexcop-usb.c 2013-10-17 11:26:41 -03:00
cpia2 [media] media: fix waitqueue_active without memory barrier in cpia2 driver 2015-11-17 14:55:06 -02:00
cx231xx [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
dvb-usb [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
dvb-usb-v2 [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
em28xx [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
go7007 [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
gspca [media] gspca: ov534/topro: prevent a division by 0 2015-11-17 14:54:25 -02:00
hackrf [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
hdpvr [media] v4l2-dv-timings: add new arg to v4l2_match_dv_timings 2015-12-03 11:26:14 -02:00
msi2500 [media] vb2: drop v4l2_format argument from queue_setup 2015-12-18 13:48:19 -02:00
pvrusb2 [media] media/usb/pvrusb2: Support for V4L2_CTRL_WHICH_DEF_VAL 2015-11-17 14:46:44 -02:00
pwc [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
s2255 [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
siano [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
stk1160 [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
stkwebcam [media] stk-webcam: Delete an unnecessary check before the function call "vfree" 2015-03-02 14:53:27 -03:00
tm6000 [media] include/media: split I2C headers from V4L2 core 2015-11-17 06:57:11 -02:00
ttusb-budget [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
ttusb-dec [media] ttusb-dec: constify ttusbdecfe_config structure 2015-11-19 11:22:15 -02:00
usbtv [media] media: videobuf2: Move timestamp to vb2_buffer 2015-12-18 13:53:31 -02:00
usbvision [media] usbvision: fix crash on detecting device with invalid configuration 2015-11-19 11:36:02 -02:00
uvc [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
zr364xx [media] usb drivers: use BUG_ON() instead of if () BUG 2015-06-09 18:30:09 -03:00
Kconfig [media] tlg2300: move to staging in preparation for removal 2014-12-16 23:21:43 -02:00
Makefile [media] tlg2300: move to staging in preparation for removal 2014-12-16 23:21:43 -02:00