]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
media: i2c: imx219: Fix a bug in imx219_enum_frame_size
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Tue, 31 Mar 2020 18:06:30 +0000 (20:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:32:23 +0000 (09:32 +0200)
[ Upstream commit b2bbf1aac61186ef904fd28079e847d3feadb89e ]

When enumerating the frame sizes, the value sent to
imx219_get_format_code should be fse->code
(the code from the ioctl) and not imx219->fmt.code
which is the code set currently in the driver.

Fixes: 22da1d56e982 ("media: i2c: imx219: Add support for RAW8 bit bayer format")
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Reviewed-by: Helen Koike <helen.koike@collabora.com>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/imx219.c

index cb03bdec1f9c89549033f45851d8192782466221..86e0564bfb4fde8aee3dcf21dc461467621dc28d 100644 (file)
@@ -781,7 +781,7 @@ static int imx219_enum_frame_size(struct v4l2_subdev *sd,
        if (fse->index >= ARRAY_SIZE(supported_modes))
                return -EINVAL;
 
-       if (fse->code != imx219_get_format_code(imx219, imx219->fmt.code))
+       if (fse->code != imx219_get_format_code(imx219, fse->code))
                return -EINVAL;
 
        fse->min_width = supported_modes[fse->index].width;