[media] media: Use the new media graph walk interface
authorSakari Ailus <sakari.ailus@iki.fi>
Wed, 16 Dec 2015 13:32:23 +0000 (15:32 +0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:19:18 +0000 (12:19 -0200)
The media graph walk requires initialisation and cleanup soon. Update the
users to perform the soon necessary API calls.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/media-entity.c

index 9bf96c71374ee500dcb86a7a5a87e2839b6a60c4..85af715d2a20e1b522d2aebbd933f067e6b4a7cf 100644 (file)
@@ -383,7 +383,13 @@ __must_check int media_entity_pipeline_start(struct media_entity *entity,
 
        mutex_lock(&mdev->graph_mutex);
 
-       media_entity_graph_walk_start(graph, entity);
+       ret = media_entity_graph_walk_init(&pipe->graph, mdev);
+       if (ret) {
+               mutex_unlock(&mdev->graph_mutex);
+               return ret;
+       }
+
+       media_entity_graph_walk_start(&pipe->graph, entity);
 
        while ((entity = media_entity_graph_walk_next(graph))) {
                DECLARE_BITMAP(active, MEDIA_ENTITY_MAX_PADS);
@@ -481,6 +487,8 @@ error:
                        break;
        }
 
+       media_entity_graph_walk_cleanup(graph);
+
        mutex_unlock(&mdev->graph_mutex);
 
        return ret;
@@ -502,6 +510,8 @@ void media_entity_pipeline_stop(struct media_entity *entity)
                        entity->pipe = NULL;
        }
 
+       media_entity_graph_walk_cleanup(graph);
+
        mutex_unlock(&mdev->graph_mutex);
 }
 EXPORT_SYMBOL_GPL(media_entity_pipeline_stop);