linux/drivers/media/common/siano
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
..
Kconfig [media] sms: Remove CONFIG_ prefix from Kconfig symbols 2014-07-22 09:57:28 -03:00
Makefile [media] siano: split debugfs code into a separate file 2013-03-21 07:48:41 -03:00
sms-cards.c [media] siano: get rid of sms_dbg parameter 2015-02-26 09:10:05 -03:00
sms-cards.h [media] siano: use pr_* print functions 2015-02-26 09:10:01 -03:00
smscoreapi.c [media] siano: register media controller earlier 2015-02-26 09:10:39 -03:00
smscoreapi.h [media] siano: define SRVM_MAX_PID_FILTERS only once 2015-05-13 17:01:44 -03:00
smsdvb-debugfs.c [media] siano: replace sms_err by pr_err 2015-02-26 09:10:02 -03:00
smsdvb-main.c [media] media-device: split media initialization and registration 2016-01-11 12:19:15 -02:00
smsdvb.h [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
smsendian.c [media] siano: remove the remaining CamelCase compliants 2013-03-21 10:03:45 -03:00
smsendian.h
smsir.c media: replace bellow -> below 2015-05-08 14:48:48 -03:00
smsir.h smsir.h: remove a now duplicated definition (IR_DEFAULT_TIMEOUT) 2015-11-19 11:41:36 -02:00