[media] v4l: vsp1: create pad links after subdev registration
authorJavier Martinez Canillas <javier@osg.samsung.com>
Thu, 3 Sep 2015 14:20:34 +0000 (11:20 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:18:45 +0000 (12:18 -0200)
The vsp1 driver creates the pads links before the media entities are
registered with the media device. This doesn't work now that object
IDs are used to create links so the media_device has to be set.

Move entities registration logic before pads links creation.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/platform/vsp1/vsp1_drv.c

index 9cd94a76a9ed2b1a95370c61f6e86f7666fd2cb3..2aa427d3ff397290721392fdef8a2a33ee930bf8 100644 (file)
@@ -250,6 +250,14 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
                list_add_tail(&wpf->entity.list_dev, &vsp1->entities);
        }
 
+       /* Register all subdevs. */
+       list_for_each_entry(entity, &vsp1->entities, list_dev) {
+               ret = v4l2_device_register_subdev(&vsp1->v4l2_dev,
+                                                 &entity->subdev);
+               if (ret < 0)
+                       goto done;
+       }
+
        /* Create links. */
        list_for_each_entry(entity, &vsp1->entities, list_dev) {
                if (entity->type == VSP1_ENTITY_LIF ||
@@ -269,14 +277,6 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
                        return ret;
        }
 
-       /* Register all subdevs. */
-       list_for_each_entry(entity, &vsp1->entities, list_dev) {
-               ret = v4l2_device_register_subdev(&vsp1->v4l2_dev,
-                                                 &entity->subdev);
-               if (ret < 0)
-                       goto done;
-       }
-
        ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev);
 
 done: