diff options
author | Sakari Ailus <sakari.ailus@iki.fi> | 2015-12-16 08:32:22 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-01-11 09:19:18 -0500 |
commit | e03d220336dd69292370393f5eee98ac17eda308 (patch) | |
tree | 2815c164379aca3f8b937a5c44d3799b6b5d2f7d /drivers/media/media-entity.c | |
parent | 5dd8775dc6b480f67be11108d7cd798fba724cab (diff) |
[media] media: Amend media graph walk API by init and cleanup functions
Add media_entity_graph_walk_init() and media_entity_graph_walk_cleanup()
functions in order to dynamically allocate memory for the graph. This is
not done in media_entity_graph_walk_start() as there are situations where
e.g. correct error handling, that itself may not fail, requires successful
graph walk.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/media-entity.c')
-rw-r--r-- | drivers/media/media-entity.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index 83cfde6dcb1c..9bf96c71374e 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c | |||
@@ -282,6 +282,33 @@ static struct media_entity *stack_pop(struct media_entity_graph *graph) | |||
282 | #define link_top(en) ((en)->stack[(en)->top].link) | 282 | #define link_top(en) ((en)->stack[(en)->top].link) |
283 | #define stack_top(en) ((en)->stack[(en)->top].entity) | 283 | #define stack_top(en) ((en)->stack[(en)->top].entity) |
284 | 284 | ||
285 | /** | ||
286 | * media_entity_graph_walk_init - Allocate resources for graph walk | ||
287 | * @graph: Media graph structure that will be used to walk the graph | ||
288 | * @mdev: Media device | ||
289 | * | ||
290 | * Reserve resources for graph walk in media device's current | ||
291 | * state. The memory must be released using | ||
292 | * media_entity_graph_walk_free(). | ||
293 | * | ||
294 | * Returns error on failure, zero on success. | ||
295 | */ | ||
296 | __must_check int media_entity_graph_walk_init( | ||
297 | struct media_entity_graph *graph, struct media_device *mdev) | ||
298 | { | ||
299 | return 0; | ||
300 | } | ||
301 | EXPORT_SYMBOL_GPL(media_entity_graph_walk_init); | ||
302 | |||
303 | /** | ||
304 | * media_entity_graph_walk_cleanup - Release resources related to graph walking | ||
305 | * @graph: Media graph structure that was used to walk the graph | ||
306 | */ | ||
307 | void media_entity_graph_walk_cleanup(struct media_entity_graph *graph) | ||
308 | { | ||
309 | } | ||
310 | EXPORT_SYMBOL_GPL(media_entity_graph_walk_cleanup); | ||
311 | |||
285 | void media_entity_graph_walk_start(struct media_entity_graph *graph, | 312 | void media_entity_graph_walk_start(struct media_entity_graph *graph, |
286 | struct media_entity *entity) | 313 | struct media_entity *entity) |
287 | { | 314 | { |