OSDN Git Service

media: staging/imx: fix complete handler
authorRussell King <rmk+kernel@armlinux.org.uk>
Fri, 29 Sep 2017 21:38:39 +0000 (17:38 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 11 Dec 2017 18:04:26 +0000 (13:04 -0500)
The complete handler walks all entities, expecting to find an imx
subdevice for each and every entity.

However, camera drivers such as smiapp can themselves contain multiple
entities, for which there will not be an imx subdevice.  This causes
imx_media_find_subdev_by_sd() to fail, making the imx capture system
unusable with such cameras.

Work around this by killing the error entirely, thereby allowing
the imx capture to be used with such cameras.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/imx/imx-media-dev.c

index 47c4c95..6a773c7 100644 (file)
@@ -345,8 +345,11 @@ static int imx_media_add_vdev_to_pad(struct imx_media_dev *imxmd,
 
        sd = media_entity_to_v4l2_subdev(entity);
        imxsd = imx_media_find_subdev_by_sd(imxmd, sd);
-       if (IS_ERR(imxsd))
-               return PTR_ERR(imxsd);
+       if (IS_ERR(imxsd)) {
+               v4l2_err(&imxmd->v4l2_dev, "failed to find subdev for entity %s, sd %p err %ld\n",
+                        entity->name, sd, PTR_ERR(imxsd));
+               return 0;
+       }
 
        imxpad = &imxsd->pad[srcpad->index];
        vdev_idx = imxpad->num_vdevs;