[PATCH RFC v3 14/16] media: add a generic function to remove a link

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

 



Removing a link is simple. Yet, better to have a separate
function for it, as we'll be also sharing it with a
public API call.

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

diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c
index b8991d38c565..f43af2fda306 100644
--- a/drivers/media/media-entity.c
+++ b/drivers/media/media-entity.c
@@ -484,6 +484,12 @@ static struct media_link *__media_create_link(struct media_device *mdev,
 	return link;
 }
 
+static void __media_remove_link(struct media_link *link)
+{
+	list_del(&link->list);
+	kfree(link);
+}
+
 static void __media_entity_remove_link(struct media_entity *entity,
 				       struct media_link *link)
 {
@@ -509,11 +515,9 @@ static void __media_entity_remove_link(struct media_entity *entity,
 			break;
 
 		/* Remove the remote link */
-		list_del(&rlink->list);
-		kfree(rlink);
+		__media_remove_link(rlink);
 	}
-	list_del(&link->list);
-	kfree(link);
+	__media_remove_link(link);
 }
 
 int
-- 
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