diff options
author | Jacopo Mondi <jacopo+renesas@jmondi.org> | 2021-10-17 20:24:42 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-01-22 09:35:57 +0100 |
commit | 837f92f070f6b7e877143eb168025995688b9756 (patch) | |
tree | fe556b5e971dfa1d6d654f9f1f6e6162a3cac474 /include/media | |
parent | 17bb9bf819c542b41d7dbddd9fe1ec82ac509604 (diff) |
media: subdev: Add for_each_active_route() macro
Add a for_each_active_route() macro to replace the repeated pattern
of iterating on the active routes of a routing table.
Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/v4l2-subdev.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index 1d2a1a77bdb2..9e34c70b8d73 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -1440,6 +1440,19 @@ int v4l2_subdev_set_routing(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, const struct v4l2_subdev_krouting *routing); +struct v4l2_subdev_route * +__v4l2_subdev_next_active_route(const struct v4l2_subdev_krouting *routing, + struct v4l2_subdev_route *route); + +/** + * for_each_active_route - iterate on all active routes of a routing table + * @routing: The routing table + * @route: The route iterator + */ +#define for_each_active_route(routing, route) \ + for ((route) = NULL; \ + ((route) = __v4l2_subdev_next_active_route((routing), (route)));) + #endif /* CONFIG_VIDEO_V4L2_SUBDEV_API */ #endif /* CONFIG_MEDIA_CONTROLLER */ |