]> git.baikalelectronics.ru Git - kernel.git/commit
[media] media-device: check before unregister if mdev was registered
authorJavier Martinez Canillas <javier@osg.samsung.com>
Fri, 11 Dec 2015 22:57:07 +0000 (20:57 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:19:14 +0000 (12:19 -0200)
commit290851ef82d874b8a0a691952561cdf2299fd6bf
treed9e66a98fc4d237f2d073ea1b6257f204aa19c8d
parent3a3f525c48973e516ebb02556885e5607c713ebc
[media] media-device: check before unregister if mdev was registered

Most media functions that unregister, check if the corresponding register
function succeed before. So these functions can safely be called even if a
registration was never made or the component as already been unregistered.

Add the same check to media_device_unregister() function for consistency.

This will also allow to split the media_device_register() function in an
initialization and registration functions without the need to change the
generic cleanup functions and error code paths for all the media drivers.

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>
drivers/media/media-device.c