]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 10 Jul 2018 08:00:53 +0000 (04:00 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 31 Aug 2018 15:13:09 +0000 (11:13 -0400)
commit0a4818e61857fbd0034aa74ab5d33b8b418de083
treea0cbd5fb28148dff19e8616a7c7e3d8ce79ab373
parente2e58e541df1f12ca5c82ecf07b2a751375c0c83
media: v4l2-ctrls: add v4l2_ctrl_request_hdl_find/put/ctrl_find functions

If a driver needs to find/inspect the controls set in a request then
it can use these functions.

E.g. to check if a required control is set in a request use this in the
req_validate() implementation:

int res = -EINVAL;

hdl = v4l2_ctrl_request_hdl_find(req, parent_hdl);
if (hdl) {
if (v4l2_ctrl_request_hdl_ctrl_find(hdl, ctrl_id))
res = 0;
v4l2_ctrl_request_hdl_put(hdl);
}
return res;

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/v4l2-core/v4l2-ctrls.c
include/media/v4l2-ctrls.h