summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo+renesas@jmondi.org>2022-08-31 16:13:28 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-09-24 09:09:50 +0200
commit8db465f7d6a0fb573d8f7c953d336b8470c0e831 (patch)
tree58bb51fb5c54dc7e881fa846d2325a0e42b8719e /include/media
parentb7319e2bd7bd7740a405719727e6fc01be1363ef (diff)
downloadlinux-8db465f7d6a0fb573d8f7c953d336b8470c0e831.tar.bz2
media: mc: entity: Add iterator helper for entity pads
Add an iterator helper to easily cycle through all pads in an entity and use it in media-entity and media-device code where appropriate. Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/media-entity.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 198ea1416ddd..a5a50350e954 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -317,6 +317,18 @@ struct media_entity {
};
/**
+ * media_entity_for_each_pad - Iterate on all pads in an entity
+ * @entity: The entity the pads belong to
+ * @iter: The iterator pad
+ *
+ * Iterate on all pads in a media entity.
+ */
+#define media_entity_for_each_pad(entity, iter) \
+ for (iter = (entity)->pads; \
+ iter < &(entity)->pads[(entity)->num_pads]; \
+ ++iter)
+
+/**
* struct media_interface - A media interface graph object.
*
* @graph_obj: embedded graph object