summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-21 09:23:22 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:18:48 -0200
commit57cf79b79b18d885c144889989b47149e23c8dc2 (patch)
tree839f57209d8a11d881efc88c629c8573860c8365 /drivers
parent8211b187ec6461e8d80a36304bd9fc087e3c490f (diff)
[media] media: add a linked list to track interfaces by mdev
The media device should list the interface objects, so add a linked list for those interfaces in struct media_device. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/media-device.c1
-rw-r--r--drivers/media/media-entity.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index 3e649cacfc07..659507bce63f 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -381,6 +381,7 @@ int __must_check __media_device_register(struct media_device *mdev,
return -EINVAL;
INIT_LIST_HEAD(&mdev->entities);
+ INIT_LIST_HEAD(&mdev->interfaces);
spin_lock_init(&mdev->lock);
mutex_init(&mdev->graph_mutex);
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index d15797e8a142..8449274bb50c 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -849,6 +849,8 @@ static void media_interface_init(struct media_device *mdev,
INIT_LIST_HEAD(&intf->links);
media_gobj_init(mdev, gobj_type, &intf->graph_obj);
+
+ list_add_tail(&intf->list, &mdev->interfaces);
}
/* Functions related to the media interface via device nodes */
@@ -877,6 +879,7 @@ EXPORT_SYMBOL_GPL(media_devnode_create);
void media_devnode_remove(struct media_intf_devnode *devnode)
{
media_gobj_remove(&devnode->intf.graph_obj);
+ list_del(&devnode->intf.list);
kfree(devnode);
}
EXPORT_SYMBOL_GPL(media_devnode_remove);