summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-12-11 11:19:38 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-01-11 12:19:05 -0200
commit5abad22fd1402c23da1f6ade8cec59ac07a28fc5 (patch)
treea29d38b9f882e760f26d776a8e821c09aaaf01ca /drivers
parent97d0a70ae5e2391f213966a69c3b6f96f2c9f25b (diff)
downloadlinux-stable-5abad22fd1402c23da1f6ade8cec59ac07a28fc5.tar.gz
linux-stable-5abad22fd1402c23da1f6ade8cec59ac07a28fc5.tar.bz2
linux-stable-5abad22fd1402c23da1f6ade8cec59ac07a28fc5.zip
[media] media-entity: get rid of forward __media_entity_remove_link() declaration
Move this function to happen earlier, in order to avoid a uneeded forward declaration. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/media-entity.c67
1 files changed, 32 insertions, 35 deletions
diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 5a5432524c10..452af1d5a20d 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -588,7 +588,38 @@ static struct media_link *media_add_link(struct list_head *head)
}
static void __media_entity_remove_link(struct media_entity *entity,
- struct media_link *link);
+ struct media_link *link)
+{
+ struct media_link *rlink, *tmp;
+ struct media_entity *remote;
+ unsigned int r = 0;
+
+ if (link->source->entity == entity)
+ remote = link->sink->entity;
+ else
+ remote = link->source->entity;
+
+ list_for_each_entry_safe(rlink, tmp, &remote->links, list) {
+ if (rlink != link->reverse) {
+ r++;
+ continue;
+ }
+
+ if (link->source->entity == entity)
+ remote->num_backlinks--;
+
+ /* Remove the remote link */
+ list_del(&rlink->list);
+ media_gobj_remove(&rlink->graph_obj);
+ kfree(rlink);
+
+ if (--remote->num_links == 0)
+ break;
+ }
+ list_del(&link->list);
+ media_gobj_remove(&link->graph_obj);
+ kfree(link);
+}
int
media_create_pad_link(struct media_entity *source, u16 source_pad,
@@ -642,40 +673,6 @@ media_create_pad_link(struct media_entity *source, u16 source_pad,
}
EXPORT_SYMBOL_GPL(media_create_pad_link);
-static void __media_entity_remove_link(struct media_entity *entity,
- struct media_link *link)
-{
- struct media_link *rlink, *tmp;
- struct media_entity *remote;
- unsigned int r = 0;
-
- if (link->source->entity == entity)
- remote = link->sink->entity;
- else
- remote = link->source->entity;
-
- list_for_each_entry_safe(rlink, tmp, &remote->links, list) {
- if (rlink != link->reverse) {
- r++;
- continue;
- }
-
- if (link->source->entity == entity)
- remote->num_backlinks--;
-
- /* Remove the remote link */
- list_del(&rlink->list);
- media_gobj_remove(&rlink->graph_obj);
- kfree(rlink);
-
- if (--remote->num_links == 0)
- break;
- }
- list_del(&link->list);
- media_gobj_remove(&link->graph_obj);
- kfree(link);
-}
-
void __media_entity_remove_links(struct media_entity *entity)
{
struct media_link *link, *tmp;