[media] media: Add an API to manage entity enumerations
This is useful in e.g. knowing whether certain operations have already been performed for an entity. The users include the framework itself (for graph walking) and a number of drivers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:

committed by
Mauro Carvalho Chehab

parent
665faa971d
commit
c8d54cd53b
@@ -341,6 +341,21 @@ struct media_device {
|
||||
/* media_devnode to media_device */
|
||||
#define to_media_device(node) container_of(node, struct media_device, devnode)
|
||||
|
||||
/**
|
||||
* media_entity_enum_init - Initialise an entity enumeration
|
||||
*
|
||||
* @e: Entity enumeration to be initialised
|
||||
* @mdev: The related media device
|
||||
*
|
||||
* Returns zero on success or a negative error code.
|
||||
*/
|
||||
static inline __must_check int media_entity_enum_init(
|
||||
struct media_entity_enum *ent_enum, struct media_device *mdev)
|
||||
{
|
||||
return __media_entity_enum_init(ent_enum,
|
||||
mdev->entity_internal_idx_max + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* media_device_init() - Initializes a media device element
|
||||
*
|
||||
|
Reference in New Issue
Block a user