linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] media: staging/imx: fix complete handler
@ 2017-09-29 21:38 Russell King
  2017-09-30  9:28 ` Mauro Carvalho Chehab
  2017-10-01 20:16 ` Steve Longerbeam
  0 siblings, 2 replies; 7+ messages in thread
From: Russell King @ 2017-09-29 21:38 UTC (permalink / raw)
  To: Steve Longerbeam
  Cc: Philipp Zabel, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	linux-media, devel

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>
---
Not the best solution, but the only one I can think of to fix the
regression that happened sometime between a previous revision of
Steve's patch set and the version that got merged.

 drivers/staging/media/imx/imx-media-dev.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-dev.c b/drivers/staging/media/imx/imx-media-dev.c
index d96f4512224f..6ba59939dd7a 100644
--- a/drivers/staging/media/imx/imx-media-dev.c
+++ b/drivers/staging/media/imx/imx-media-dev.c
@@ -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;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-03 18:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-29 21:38 [PATCH RFC] media: staging/imx: fix complete handler Russell King
2017-09-30  9:28 ` Mauro Carvalho Chehab
2017-10-01 20:16 ` Steve Longerbeam
2017-10-01 23:36   ` Russell King - ARM Linux
2017-10-03  0:59     ` Steve Longerbeam
2017-10-03  9:06       ` Russell King - ARM Linux
2017-10-03 18:48         ` Steve Longerbeam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).