Commit 8c0aa95d authored by Dorota Czaplejewicz's avatar Dorota Czaplejewicz
Browse files

Fix enumerating frame sizes

parent 0baef5bf
......@@ -726,15 +726,20 @@ static int s5k3l6xx_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_pad_config *cfg,
struct v4l2_subdev_frame_size_enum *fse)
{
int i;
unsigned i;
unsigned matching = 0;
for (i = 0; i++; i <= ARRAY_SIZE(s5k3l6xx_frames)) {
if (fse->code != s5k3l6xx_frames[i].code)
continue;
if (fse->index == matching)
break;
matching++;
}
if (fse->index > 0)
if (i >= ARRAY_SIZE(s5k3l6xx_frames))
return -EINVAL;
i = ARRAY_SIZE(s5k3l6xx_frames);
while (--i)
if (fse->code == s5k3l6xx_frames[i].code)
break;
fse->code = s5k3l6xx_frames[i].code;
fse->min_width = s5k3l6xx_frames[i].width;
fse->max_width = s5k3l6xx_frames[i].width;
......
Supports Markdown
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