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 <mche...@osg.samsung.com>

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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to