diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2020-03-03 12:02:00 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-04-21 17:01:07 +0200 |
commit | b2b1046f1de6263e6281d46fd376ee048f09d013 (patch) | |
tree | 5faa308ceadbf65fb294b35fa2df62326ffd4837 /drivers/media | |
parent | 7c3bae3f430af6b4fcbdb7272e191e266fd94b45 (diff) | |
download | linux-stable-b2b1046f1de6263e6281d46fd376ee048f09d013.tar.gz linux-stable-b2b1046f1de6263e6281d46fd376ee048f09d013.tar.bz2 linux-stable-b2b1046f1de6263e6281d46fd376ee048f09d013.zip |
media: v4l2-ctrls: add __v4l2_ctrl_s_ctrl_compound()
Rather than creating new compound control helpers for each new
type, create one generic function and just create defines on
top.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Tested-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-ctrls.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 77b0132d9f6f..1c617b42a944 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -4253,18 +4253,18 @@ int __v4l2_ctrl_s_ctrl_string(struct v4l2_ctrl *ctrl, const char *s) } EXPORT_SYMBOL(__v4l2_ctrl_s_ctrl_string); -int __v4l2_ctrl_s_ctrl_area(struct v4l2_ctrl *ctrl, - const struct v4l2_area *area) +int __v4l2_ctrl_s_ctrl_compound(struct v4l2_ctrl *ctrl, + enum v4l2_ctrl_type type, const void *p) { lockdep_assert_held(ctrl->handler->lock); /* It's a driver bug if this happens. */ - if (WARN_ON(ctrl->type != V4L2_CTRL_TYPE_AREA)) + if (WARN_ON(ctrl->type != type)) return -EINVAL; - *ctrl->p_new.p_area = *area; + memcpy(ctrl->p_new.p, p, ctrl->elems * ctrl->elem_size); return set_ctrl(NULL, ctrl, 0); } -EXPORT_SYMBOL(__v4l2_ctrl_s_ctrl_area); +EXPORT_SYMBOL(__v4l2_ctrl_s_ctrl_compound); void v4l2_ctrl_request_complete(struct media_request *req, struct v4l2_ctrl_handler *main_hdl) |