mirror of
https://github.com/torvalds/linux.git
synced 2024-12-07 19:41:31 +00:00
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>
This commit is contained in:
parent
882f261874
commit
4b1f67dc8e
@ -1520,6 +1520,10 @@ static void std_init(const struct v4l2_ctrl *ctrl, u32 idx,
|
|||||||
case V4L2_CTRL_TYPE_BOOLEAN:
|
case V4L2_CTRL_TYPE_BOOLEAN:
|
||||||
ptr.p_s32[idx] = ctrl->default_value;
|
ptr.p_s32[idx] = ctrl->default_value;
|
||||||
break;
|
break;
|
||||||
|
case V4L2_CTRL_TYPE_BUTTON:
|
||||||
|
case V4L2_CTRL_TYPE_CTRL_CLASS:
|
||||||
|
ptr.p_s32[idx] = 0;
|
||||||
|
break;
|
||||||
case V4L2_CTRL_TYPE_U8:
|
case V4L2_CTRL_TYPE_U8:
|
||||||
ptr.p_u8[idx] = ctrl->default_value;
|
ptr.p_u8[idx] = ctrl->default_value;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user