All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS
@ 2019-05-30 17:19 Ezequiel Garcia
  2019-05-30 17:19 ` [PATCH v2 2/2] media: v4l2-ctrl: Move compound control initialization Ezequiel Garcia
  2019-06-01  9:05 ` [PATCH v2 1/2] media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS Boris Brezillon
  0 siblings, 2 replies; 6+ messages in thread
From: Ezequiel Garcia @ 2019-05-30 17:19 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] 6+ messages in thread

end of thread, other threads:[~2019-06-05 10:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-30 17:19 [PATCH v2 1/2] media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS Ezequiel Garcia
2019-05-30 17:19 ` [PATCH v2 2/2] media: v4l2-ctrl: Move compound control initialization Ezequiel Garcia
2019-06-01  9:02   ` Boris Brezillon
2019-06-05 10:45   ` Hans Verkuil
2019-06-01  9:05 ` [PATCH v2 1/2] media: v4l2-ctrl: Initialize _BUTTON and _CTRL_CLASS Boris Brezillon
2019-06-05 10:44   ` Hans Verkuil

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.