aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <[email protected]>2024-06-17 18:11:32 +0200
committerLaurent Pinchart <[email protected]>2024-06-19 19:43:05 +0300
commitb0023db63c467442bc7dec8e3a299eb10ae97dec (patch)
tree72ac1a2e337df90d9c97adf0c2403271bbe84332
parent3164347e24688062f68edd43c18e1f7b38cbd357 (diff)
media: max9286: Fix enum_mbus_code
The max9286 driver supports multiple output formats but only a single one is reported through the .enum_mbus_code operation. Fix that. Signed-off-by: Jacopo Mondi <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Laurent Pinchart <[email protected]>
-rw-r--r--drivers/media/i2c/max9286.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index dfcb3fc03350..46ce8e51c011 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -914,10 +914,10 @@ static int max9286_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{
- if (code->pad || code->index > 0)
+ if (code->pad || code->index >= ARRAY_SIZE(max9286_formats))
return -EINVAL;
- code->code = MEDIA_BUS_FMT_UYVY8_1X16;
+ code->code = max9286_formats[code->index].code;
return 0;
}