diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-08-23 07:51:33 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-11 12:18:53 -0200 |
commit | 05bfa9fa1cda91953e1b5975b059542b83c5245c (patch) | |
tree | 973b1eaea741c5b5205d263dff055fb02f090dce /drivers/media/media-device.c | |
parent | cf975a4b40ec9a947dae614b23128f3984a2d324 (diff) |
[media] media: move mdev list init to gobj
Let's control the topology changes inside the graph_object. So, move the
addition and removal of interfaces/entities from the mdev lists to
media_gobj_init() and media_gobj_remove().
The main reason is that mdev should have lists for all object types, as
the new MC api will require to store objects in separate places.
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/media-device.c')
-rw-r--r-- | drivers/media/media-device.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 134fe7510195..ec98595b8a7a 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c @@ -415,7 +415,7 @@ void media_device_unregister(struct media_device *mdev) struct media_entity *entity; struct media_entity *next; - list_for_each_entry_safe(entity, next, &mdev->entities, list) + list_for_each_entry_safe(entity, next, &mdev->entities, graph_obj.list) media_device_unregister_entity(entity); device_remove_file(&mdev->devnode.dev, &dev_attr_model); @@ -449,7 +449,6 @@ int __must_check media_device_register_entity(struct media_device *mdev, spin_lock(&mdev->lock); /* Initialize media_gobj embedded at the entity */ media_gobj_init(mdev, MEDIA_GRAPH_ENTITY, &entity->graph_obj); - list_add_tail(&entity->list, &mdev->entities); /* Initialize objects at the pads */ for (i = 0; i < entity->num_pads; i++) @@ -487,7 +486,6 @@ void media_device_unregister_entity(struct media_entity *entity) for (i = 0; i < entity->num_pads; i++) media_gobj_remove(&entity->pads[i].graph_obj); media_gobj_remove(&entity->graph_obj); - list_del(&entity->list); spin_unlock(&mdev->lock); entity->graph_obj.mdev = NULL; } |