All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS
@ 2019-05-29 19:28 Ezequiel Garcia
  2019-05-29 19:28 ` [PATCH 2/2] media: v4l2-ctrl: Move compound control initialization Ezequiel Garcia
  0 siblings, 1 reply; 4+ messages in thread
From: Ezequiel Garcia @ 2019-05-29 19:28 UTC (permalink / raw)
  To: linux-media, Hans Verkuil
  Cc: kernel, Nicolas Dufresne, Boris Brezillon, Ezequiel Garcia

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>
---
 drivers/media/v4l2-core/v4l2-ctrls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c
index 1870cecad9ae..c7d5fdb8efb4 100644
--- a/drivers/media/v4l2-core/v4l2-ctrls.c
+++ b/drivers/media/v4l2-core/v4l2-ctrls.c
@@ -1530,6 +1530,8 @@ static void std_init(const struct v4l2_ctrl *ctrl, u32 idx,
 	case V4L2_CTRL_TYPE_MENU:
 	case V4L2_CTRL_TYPE_BITMASK:
 	case V4L2_CTRL_TYPE_BOOLEAN:
+	case V4L2_CTRL_TYPE_BUTTON:
+	case V4L2_CTRL_TYPE_CTRL_CLASS:
 		ptr.p_s32[idx] = ctrl->default_value;
 		break;
 	case V4L2_CTRL_TYPE_U8:
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-30 12:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 19:28 [PATCH 1/2] media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS Ezequiel Garcia
2019-05-29 19:28 ` [PATCH 2/2] media: v4l2-ctrl: Move compound control initialization Ezequiel Garcia
2019-05-30  8:03   ` Boris Brezillon
2019-05-30 12:43     ` Ezequiel Garcia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.