summaryrefslogtreecommitdiff
path: root/drivers/media/media-entity.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-14 16:42:05 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 17:18:40 +0300
commitfa762394fd85c838ade769990478bc4e01fd95e8 (patch)
tree426b044963d02003fb341dd29fbc1fa4d6213f8d /drivers/media/media-entity.c
parent20fe0319de9aca71ba45e2f93c4a2a73dabde4da (diff)
downloadlinux-fa762394fd85c838ade769990478bc4e01fd95e8.tar.xz
[media] media: create a macro to get entity ID
Instead of accessing directly entity.id, let's create a macro, as this field will be moved into a common struct later on. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/media-entity.c')
-rw-r--r--drivers/media/media-entity.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index eabcbacfe387..0342be39cae2 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -140,10 +140,10 @@ void media_entity_graph_walk_start(struct media_entity_graph *graph,
graph->stack[graph->top].entity = NULL;
bitmap_zero(graph->entities, MEDIA_ENTITY_ENUM_MAX_ID);
- if (WARN_ON(entity->id >= MEDIA_ENTITY_ENUM_MAX_ID))
+ if (WARN_ON(media_entity_id(entity) >= MEDIA_ENTITY_ENUM_MAX_ID))
return;
- __set_bit(entity->id, graph->entities);
+ __set_bit(media_entity_id(entity), graph->entities);
stack_push(graph, entity);
}
EXPORT_SYMBOL_GPL(media_entity_graph_walk_start);
@@ -184,11 +184,11 @@ media_entity_graph_walk_next(struct media_entity_graph *graph)
/* Get the entity in the other end of the link . */
next = media_entity_other(entity, link);
- if (WARN_ON(next->id >= MEDIA_ENTITY_ENUM_MAX_ID))
+ if (WARN_ON(media_entity_id(next) >= MEDIA_ENTITY_ENUM_MAX_ID))
return NULL;
/* Has the entity already been visited? */
- if (__test_and_set_bit(next->id, graph->entities)) {
+ if (__test_and_set_bit(media_entity_id(next), graph->entities)) {
link_top(graph)++;
continue;
}