Commit 334de4b4 authored by Pavel Machek's avatar Pavel Machek Committed by Mauro Carvalho Chehab

media: ipu3-cio2: Fix mbus_code processing in cio2_subdev_set_fmt()

Loop was useless as it would always exit on the first iteration. Fix
it with right condition.
Signed-off-by: default avatarPavel Machek (CIP) <pavel@denx.de>
Fixes: a86cf9b2 ("media: ipu3-cio2: Validate mbus format in setting subdev format")
Tested-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org # v4.16 and up
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent dc1eb7c9
...@@ -1269,7 +1269,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd, ...@@ -1269,7 +1269,7 @@ static int cio2_subdev_set_fmt(struct v4l2_subdev *sd,
fmt->format.code = formats[0].mbus_code; fmt->format.code = formats[0].mbus_code;
for (i = 0; i < ARRAY_SIZE(formats); i++) { for (i = 0; i < ARRAY_SIZE(formats); i++) {
if (formats[i].mbus_code == fmt->format.code) { if (formats[i].mbus_code == mbus_code) {
fmt->format.code = mbus_code; fmt->format.code = mbus_code;
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment