Skip to content

Commit 4c55b4f

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 <kieran.bingham@ideasonboard.com>
1 parent c7bb0e4 commit 4c55b4f

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
@@ -720,7 +720,8 @@ static int imx335_enum_frame_size(struct v4l2_subdev *sd,
720720
struct imx335 *imx335 = to_imx335(sd);
721721
u32 code;
722722

723-
if (fsize->index > ARRAY_SIZE(imx335_mbus_codes))
723+
/* Only a single supported_mode available. */
724+
if (fsize->index > 0)
724725
return -EINVAL;
725726

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

0 commit comments

Comments
 (0)