[media] media: Don't accept early-created links
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Wed, 19 Aug 2015 23:18:35 +0000 (20:18 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:18:46 +0000 (12:18 -0200)
Links are graph objects that represent the links of two already
existing objects in the graph.

While with the current implementation, it is possible to create
the links earlier, It doesn't make any sense to allow linking
two objects when they are not both created.

So, remove the code that would be handling those early-created
links and add a BUG_ON() to ensure that.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/media-device.c
drivers/media/media-entity.c

index 138b18416460d89ed29ace9f9ce190462b9d554c..0d85c6c28004d12c1dd988fb3d9de70a008e2528 100644 (file)
@@ -443,13 +443,6 @@ int __must_check media_device_register_entity(struct media_device *mdev,
        media_gobj_init(mdev, MEDIA_GRAPH_ENTITY, &entity->graph_obj);
        list_add_tail(&entity->list, &mdev->entities);
 
-       /*
-        * Initialize objects at the links
-        * in the case where links got created before entity register
-        */
-       for (i = 0; i < entity->num_links; i++)
-               media_gobj_init(mdev, MEDIA_GRAPH_LINK,
-                               &entity->links[i].graph_obj);
        /* Initialize objects at the pads */
        for (i = 0; i < entity->num_pads; i++)
                media_gobj_init(mdev, MEDIA_GRAPH_PAD,
index 160ce2cc0865f4e1d1c9c3f2d184f207a746aaeb..f85a711d49581f045c5ca8ceb7e4d71e40aa5c71 100644 (file)
@@ -149,6 +149,8 @@ void media_gobj_init(struct media_device *mdev,
                           enum media_gobj_type type,
                           struct media_gobj *gobj)
 {
+       BUG_ON(!mdev);
+
        gobj->mdev = mdev;
 
        /* Create a per-type unique object ID */
This page took 0.049784 seconds and 5 git commands to generate.