media: imx: capture: Return -EPIPE from __capture_legacy_try_fmt()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 15 Feb 2021 04:26:47 +0000 (05:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 May 2021 12:47:24 +0000 (14:47 +0200)
[ Upstream commit cc271b6754691af74d710b761eaf027e3743e243 ]

The correct return code to report an invalid pipeline configuration is
-EPIPE. Return it instead of -EINVAL from __capture_legacy_try_fmt()
when the capture format doesn't match the media bus format of the
connected subdev.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/imx/imx-media-capture.c

index c1931eb2540e3bc3d05550446ffc6e6c01d8a7b2..b2f2cb3d6a609b66152bacf24d73b4b5cfc4364e 100644 (file)
@@ -557,7 +557,7 @@ static int capture_validate_fmt(struct capture_priv *priv)
                priv->vdev.fmt.fmt.pix.height != f.fmt.pix.height ||
                priv->vdev.cc->cs != cc->cs ||
                priv->vdev.compose.width != compose.width ||
-               priv->vdev.compose.height != compose.height) ? -EINVAL : 0;
+               priv->vdev.compose.height != compose.height) ? -EPIPE : 0;
 }
 
 static int capture_start_streaming(struct vb2_queue *vq, unsigned int count)