mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 15:42:46 +00:00
[media] media: make add link more generic
The media_entity_add_link() function takes an entity as an argument just to get the list head. Make it more generic by changing the function argument to list_head. No functional changes. Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
57208e5e25
commit
23615de5ee
1 changed files with 4 additions and 4 deletions
|
@ -568,7 +568,7 @@ EXPORT_SYMBOL_GPL(media_entity_put);
|
||||||
* Links management
|
* Links management
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static struct media_link *media_entity_add_link(struct media_entity *entity)
|
static struct media_link *media_add_link(struct list_head *head)
|
||||||
{
|
{
|
||||||
struct media_link *link;
|
struct media_link *link;
|
||||||
|
|
||||||
|
@ -576,7 +576,7 @@ static struct media_link *media_entity_add_link(struct media_entity *entity)
|
||||||
if (link == NULL)
|
if (link == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
list_add_tail(&link->list, &entity->links);
|
list_add_tail(&link->list, head);
|
||||||
|
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
@ -595,7 +595,7 @@ media_create_pad_link(struct media_entity *source, u16 source_pad,
|
||||||
BUG_ON(source_pad >= source->num_pads);
|
BUG_ON(source_pad >= source->num_pads);
|
||||||
BUG_ON(sink_pad >= sink->num_pads);
|
BUG_ON(sink_pad >= sink->num_pads);
|
||||||
|
|
||||||
link = media_entity_add_link(source);
|
link = media_add_link(&source->links);
|
||||||
if (link == NULL)
|
if (link == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -610,7 +610,7 @@ media_create_pad_link(struct media_entity *source, u16 source_pad,
|
||||||
/* Create the backlink. Backlinks are used to help graph traversal and
|
/* Create the backlink. Backlinks are used to help graph traversal and
|
||||||
* are not reported to userspace.
|
* are not reported to userspace.
|
||||||
*/
|
*/
|
||||||
backlink = media_entity_add_link(sink);
|
backlink = media_add_link(&sink->links);
|
||||||
if (backlink == NULL) {
|
if (backlink == NULL) {
|
||||||
__media_entity_remove_link(source, link);
|
__media_entity_remove_link(source, link);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue