Skip to content

Commit 3b9c996

Browse files
kbinghampopcornmix
authored andcommitted
drivers: media: i2c: imx335: Fix frame size enumeration
In commit cfa49ff ("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: cfa49ff ("media: i2c: imx335: Support 2592x1940 10-bit mode") Signed-off-by: Kieran Bingham <[email protected]>
1 parent fb12cea commit 3b9c996

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/media/i2c/imx335.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,8 @@ static int imx335_enum_frame_size(struct v4l2_subdev *sd,
718718
struct imx335 *imx335 = to_imx335(sd);
719719
u32 code;
720720

721-
if (fsize->index > ARRAY_SIZE(imx335_mbus_codes))
721+
/* Only a single supported_mode available. */
722+
if (fsize->index > 0)
722723
return -EINVAL;
723724

724725
code = imx335_get_format_code(imx335, fsize->code);

0 commit comments

Comments
 (0)