Commit 8f6d368f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] media: Don't accept early-created links

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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent ada58ced
...@@ -443,13 +443,6 @@ int __must_check media_device_register_entity(struct media_device *mdev, ...@@ -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); media_gobj_init(mdev, MEDIA_GRAPH_ENTITY, &entity->graph_obj);
list_add_tail(&entity->list, &mdev->entities); 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 */ /* Initialize objects at the pads */
for (i = 0; i < entity->num_pads; i++) for (i = 0; i < entity->num_pads; i++)
media_gobj_init(mdev, MEDIA_GRAPH_PAD, media_gobj_init(mdev, MEDIA_GRAPH_PAD,
......
...@@ -149,6 +149,8 @@ void media_gobj_init(struct media_device *mdev, ...@@ -149,6 +149,8 @@ void media_gobj_init(struct media_device *mdev,
enum media_gobj_type type, enum media_gobj_type type,
struct media_gobj *gobj) struct media_gobj *gobj)
{ {
BUG_ON(!mdev);
gobj->mdev = mdev; gobj->mdev = mdev;
/* Create a per-type unique object ID */ /* Create a per-type unique object ID */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment