[media] media: use media_gobj inside entities
As entities are graph objects, let's embed media_gobj
on it. That ensures an unique ID for entities that can be
global along the entire media controller.
For now, we'll keep the already existing entity ID. Such
field need to be dropped at some point, but for now, let's
not do this, to avoid needing to review all drivers and
the userspace apps.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index a76655c..9f6f056 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -43,7 +43,12 @@
enum media_gobj_type type,
struct media_gobj *gobj)
{
- /* For now, nothing to do */
+ /* Create a per-type unique object ID */
+ switch (type) {
+ case MEDIA_GRAPH_ENTITY:
+ gobj->id = media_gobj_gen_id(type, ++mdev->entity_id);
+ break;
+ }
}
/**