diff options
author | Florin Tudorache <florin_tudorache@live.com> | 2020-06-28 11:24:47 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-07-19 08:16:47 +0200 |
commit | 44d42520df8a67f47c1e47d934d6bcd38d87daac (patch) | |
tree | 0e3a159d26901111cb501313f27ba89a3ae5a8fa | |
parent | 94b9ce6870f9c90ac92505482689818b254312f7 (diff) | |
download | linux-44d42520df8a67f47c1e47d934d6bcd38d87daac.tar.gz linux-44d42520df8a67f47c1e47d934d6bcd38d87daac.tar.bz2 linux-44d42520df8a67f47c1e47d934d6bcd38d87daac.zip |
gspca: First camera mode is skipped
If a device supports a resolution in 2 different formats, mode[0] is
skipped on first iteration and a different format is selected.
Example: 320x240/YUYV isn't reachable for OV534/ov772x
Signed-off-by: Florin Tudorache <florin_tudorache@live.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/usb/gspca/gspca.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c index 0566e00d6fea..c295f642d352 100644 --- a/drivers/media/usb/gspca/gspca.c +++ b/drivers/media/usb/gspca/gspca.c @@ -925,7 +925,7 @@ static int wxh_to_nearest_mode(struct gspca_dev *gspca_dev, { int i; - for (i = gspca_dev->cam.nmodes; --i > 0; ) { + for (i = gspca_dev->cam.nmodes; --i >= 0; ) { if (width >= gspca_dev->cam.cam_mode[i].width && height >= gspca_dev->cam.cam_mode[i].height && pixelformat == gspca_dev->cam.cam_mode[i].pixelformat) |