[PATCH RFC v2 12/16] media: move __media_entity_remove_link to avoid prototype

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As we need __media_entity_remove_link() earlier, move it to
happen earlier, to avoid needing to have a function prototype.

No functional changes.

Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx>

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index 43fa8ac59055..96d48aec8381 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -481,7 +481,36 @@ static struct media_link *media_entity_add_link(struct media_entity *entity)
 }
 
 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 (gobj_to_pad(link->source)->entity == entity)
+		remote = gobj_to_pad(link->sink)->entity;
+	else
+		remote = gobj_to_pad(link->source)->entity;
+
+	list_for_each_entry_safe(rlink, tmp, &remote->links, list) {
+		if (rlink != link->reverse) {
+			r++;
+			continue;
+		}
+
+		if (gobj_to_pad(link->source)->entity == entity)
+			remote->num_backlinks--;
+
+		if (--remote->num_links == 0)
+			break;
+
+		/* Remove the remote link */
+		list_del(&rlink->list);
+		kfree(rlink);
+	}
+	list_del(&link->list);
+	kfree(link);
+}
 
 int
 media_create_pad_link(struct media_entity *source, u16 source_pad,
@@ -524,38 +553,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 (gobj_to_pad(link->source)->entity == entity)
-		remote = gobj_to_pad(link->sink)->entity;
-	else
-		remote = gobj_to_pad(link->source)->entity;
-
-	list_for_each_entry_safe(rlink, tmp, &remote->links, list) {
-		if (rlink != link->reverse) {
-			r++;
-			continue;
-		}
-
-		if (gobj_to_pad(link->source)->entity == entity)
-			remote->num_backlinks--;
-
-		if (--remote->num_links == 0)
-			break;
-
-		/* Remove the remote link */
-		list_del(&rlink->list);
-		kfree(rlink);
-	}
-	list_del(&link->list);
-	kfree(link);
-}
-
 void __media_entity_remove_links(struct media_entity *entity)
 {
 	struct media_link *link, *tmp;
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux