media: staging: media: imx: imx7-media-csi: Simplify default mbus code in try_fmt

When trying a format on the subdev sink pad, if the requested media bus
code isn't supported, fallback to the default with a simpler logic.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Rui Miguel Silva <rmfrfs@gmail.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
Laurent Pinchart 2022-05-10 03:06:45 +01:00 committed by Mauro Carvalho Chehab
parent 148709ad22
commit 539a985976

View File

@ -1973,11 +1973,10 @@ static int imx7_csi_try_fmt(struct imx7_csi *csi,
*cc = imx7_csi_find_mbus_format(sdformat->format.code,
IMX7_CSI_PIXFMT_SEL_ANY);
if (!*cc) {
imx7_csi_enum_mbus_formats(&code, 0,
IMX7_CSI_PIXFMT_SEL_YUV_RGB);
code = IMX7_CSI_DEF_MBUS_CODE;
*cc = imx7_csi_find_mbus_format(code,
IMX7_CSI_PIXFMT_SEL_YUV_RGB);
sdformat->format.code = (*cc)->codes[0];
IMX7_CSI_PIXFMT_SEL_ANY);
sdformat->format.code = code;
}
if (sdformat->format.field != V4L2_FIELD_INTERLACED)