diff options
author | Ezequiel Garcia <ezequiel@collabora.com> | 2019-06-06 19:12:53 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-06-21 23:18:33 +0300 |
commit | 4b1f67dc8edcb4a1e8a1d141609d89fa7d430d46 (patch) | |
tree | 862c2ee50a38238eb16904bf0ee681a2c7c10d1b /drivers/media/v4l2-core | |
parent | 882f261874c9aa3792e37d631342e84c84766dd0 (diff) | |
download | linux-4b1f67dc8edcb4a1e8a1d141609d89fa7d430d46.tar.xz |
media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS
These two control types don't really need a default value,
as they are not expected to carry any value.
However, it's slightly clearer to initialize them explicitly
instead of falling back to the switch default.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-ctrls.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index f2b9bdedbf8c..2d7525e2d9eb 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1520,6 +1520,10 @@ static void std_init(const struct v4l2_ctrl *ctrl, u32 idx, case V4L2_CTRL_TYPE_BOOLEAN: ptr.p_s32[idx] = ctrl->default_value; break; + case V4L2_CTRL_TYPE_BUTTON: + case V4L2_CTRL_TYPE_CTRL_CLASS: + ptr.p_s32[idx] = 0; + break; case V4L2_CTRL_TYPE_U8: ptr.p_u8[idx] = ctrl->default_value; break; |