From 940758919cb39f3570fb7c4d8652df20169738cf Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 28 Apr 2025 17:07:20 +0100 Subject: [PATCH] drivers: media: i2c: imx335: Fix frame size enumeration In commit cfa49ff0558a ("media: i2c: imx335: Support 2592x1940 10-bit mode") the IMX335 driver was extended to support multiple output modes. This incorrectly extended the frame size enumeration to check against the supported mbus_codes array instead of the supported mode/frame array. This has the unwanted side effect of reporting the currently supported frame size 2592x1944 three times. Fix the check accordingly to report a frame size for each supported size, which is presently only a single entry. Fixes: cfa49ff0558a ("media: i2c: imx335: Support 2592x1940 10-bit mode") Signed-off-by: Kieran Bingham --- drivers/media/i2c/imx335.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/imx335.c b/drivers/media/i2c/imx335.c index 237dd39d5daea3..078583c70e34ba 100644 --- a/drivers/media/i2c/imx335.c +++ b/drivers/media/i2c/imx335.c @@ -718,7 +718,8 @@ static int imx335_enum_frame_size(struct v4l2_subdev *sd, struct imx335 *imx335 = to_imx335(sd); u32 code; - if (fsize->index > ARRAY_SIZE(imx335_mbus_codes)) + /* Only a single supported_mode available. */ + if (fsize->index > 0) return -EINVAL; code = imx335_get_format_code(imx335, fsize->code);