@@ -439,21 +439,16 @@ static int vsp1_video_pipeline_build_branch(struct vsp1_pipeline *pipe,
static int vsp1_video_pipeline_build(struct vsp1_pipeline *pipe,
struct vsp1_video *video)
{
- struct media_graph graph;
- struct media_entity *entity = &video->video.entity;
- struct media_device *mdev = entity->graph_obj.mdev;
+ struct media_pipeline_entity_iter iter;
+ struct media_entity *entity;
struct list_head *cursor;
unsigned int i;
int ret;
- /* Walk the graph to locate the entities and video nodes. */
- ret = media_graph_walk_init(&graph, mdev);
- if (ret)
- return ret;
+ /* Iterate over the pipeline to locate the entities and video nodes. */
+ media_pipeline_entity_iter_init(&pipe->pipe, &iter);
- media_graph_walk_start(&graph, entity);
-
- while ((entity = media_graph_walk_next(&graph))) {
+ media_pipeline_for_each_entity(&pipe->pipe, &iter, entity) {
struct v4l2_subdev *subdev;
struct vsp1_rwpf *rwpf;
struct vsp1_entity *e;
@@ -501,7 +496,7 @@ static int vsp1_video_pipeline_build(struct vsp1_pipeline *pipe,
}
}
- media_graph_walk_cleanup(&graph);
+ media_pipeline_entity_iter_cleanup(&iter);
/* We need one output and at least one input. */
if (pipe->num_inputs == 0 || !pipe->output)
Replace the soon to be deprecated graph walk API with the more efficient iterator over entities in the media pipeline. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> --- .../media/platform/renesas/vsp1/vsp1_video.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)