summaryrefslogtreecommitdiffstats
path: root/drivers/media/media-device.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-23 08:00:33 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:18:53 -0200
commit9155d859b6bec29cdbbd80a509be35de55115f00 (patch)
tree994e634d93e8652cd1105b83ac565d91c21546d4 /drivers/media/media-device.c
parent05bfa9fa1cda91953e1b5975b059542b83c5245c (diff)
[media] media-device: add pads and links to media_device
The MC next gen API sends objects to userspace grouped by their types. In the case of pads and links, in order to improve performance and have a simpler code, the best is to store them also on separate linked lists at MC. If we don't do that, we would need this kind of interaction to send data to userspace (code is in structured english): for each entity: for each pad: store pads for each entity: for each link: store link for each interface: for each link: store link With would require one nested loop for pads and two nested loops for links. By using separate linked lists for them, just one loop would be enough. 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c
index ec98595b8a7a..5b2c9f7fcd45 100644
--- a/drivers/media/media-device.c
+++ b/drivers/media/media-device.c
@@ -382,6 +382,8 @@ int __must_check __media_device_register(struct media_device *mdev,
INIT_LIST_HEAD(&mdev->entities);
INIT_LIST_HEAD(&mdev->interfaces);
+ INIT_LIST_HEAD(&mdev->pads);
+ INIT_LIST_HEAD(&mdev->links);
spin_lock_init(&mdev->lock);
mutex_init(&mdev->graph_mutex);