Commit 44d42520 authored by Florin Tudorache's avatar Florin Tudorache Committed by Mauro Carvalho Chehab

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: default avatarFlorin Tudorache <florin_tudorache@live.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 94b9ce68
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment