Skip to content
Commit cecfe9b8 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] v4l2-ctrls.c: allow empty control handlers



If you have a control handler that does not contain any controls, then
currently calling VIDIOC_G/S/TRY_EXT_CTRLS with count == 0 will return
-EINVAL in the class_check() function.

This is not correct, there is no reason why this should return an error.

The purpose of setting count to 0 is to test if the ioctl can mix controls
from different control classes. And this is possible. The fact that there
are not actually any controls defined is another matter that is unrelated
to this test.

This caused v4l2-compliance to fail, so that is fixed with this patch applied.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Reported-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.org>
Tested-by: default avatarDave Stevenson <dave.stevenson@raspberrypi.org>
Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 5b2c8da1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment