Message ID | 20240430103956.60190-10-jacopo.mondi@ideasonboard.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | b0023db63c467442bc7dec8e3a299eb10ae97dec |
Delegated to: | Kieran Bingham |
Headers | show |
Series | [01/19] media: adv748x: Add support for active state | expand |
Hi Jacopo, Thank you for the patch. On Tue, Apr 30, 2024 at 12:39:45PM +0200, Jacopo Mondi wrote: > The max9286 driver supports multiple output formats but only a single > one is reported theough the .enum_mbus_code operation. > > Fix that. > Please add a Fixes: tag. > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> > --- > drivers/media/i2c/max9286.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c > index fb13bfde42df..575d8ac8efa1 100644 > --- a/drivers/media/i2c/max9286.c > +++ b/drivers/media/i2c/max9286.c > @@ -917,10 +917,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; > }
diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c index fb13bfde42df..575d8ac8efa1 100644 --- a/drivers/media/i2c/max9286.c +++ b/drivers/media/i2c/max9286.c @@ -917,10 +917,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; }
The max9286 driver supports multiple output formats but only a single one is reported theough the .enum_mbus_code operation. Fix that. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- drivers/media/i2c/max9286.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)