mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
[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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
5dd8775dc6
commit
e03d220336
2 changed files with 39 additions and 5 deletions
|
|
@ -282,6 +282,33 @@ static struct media_entity *stack_pop(struct media_entity_graph *graph)
|
|||
#define link_top(en) ((en)->stack[(en)->top].link)
|
||||
#define stack_top(en) ((en)->stack[(en)->top].entity)
|
||||
|
||||
/**
|
||||
* media_entity_graph_walk_init - Allocate resources for graph walk
|
||||
* @graph: Media graph structure that will be used to walk the graph
|
||||
* @mdev: Media device
|
||||
*
|
||||
* Reserve resources for graph walk in media device's current
|
||||
* state. The memory must be released using
|
||||
* media_entity_graph_walk_free().
|
||||
*
|
||||
* Returns error on failure, zero on success.
|
||||
*/
|
||||
__must_check int media_entity_graph_walk_init(
|
||||
struct media_entity_graph *graph, struct media_device *mdev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(media_entity_graph_walk_init);
|
||||
|
||||
/**
|
||||
* media_entity_graph_walk_cleanup - Release resources related to graph walking
|
||||
* @graph: Media graph structure that was used to walk the graph
|
||||
*/
|
||||
void media_entity_graph_walk_cleanup(struct media_entity_graph *graph)
|
||||
{
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(media_entity_graph_walk_cleanup);
|
||||
|
||||
void media_entity_graph_walk_start(struct media_entity_graph *graph,
|
||||
struct media_entity *entity)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue