summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2022-07-11 12:21:07 +0200
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-08-19 13:46:11 +0200
commit5f2c5c69a61dc5411d436c1a422f8a1ee195a924 (patch)
treecd64f1180dedbf79c09cfd09ee8253d6aaf9a248 /include/media
parent568035b01cfb107af8d2e4bd2fb9aea22cf5b868 (diff)
downloadlinux-5f2c5c69a61dc5411d436c1a422f8a1ee195a924.tar.gz
linux-5f2c5c69a61dc5411d436c1a422f8a1ee195a924.tar.bz2
linux-5f2c5c69a61dc5411d436c1a422f8a1ee195a924.zip
media: v4l2-ctrls: allocate space for arrays
Just like dynamic arrays, also allocate space for regular arrays. This is in preparation for allowing to change the array size from a driver. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-ctrls.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 00828a4f9404..5ddd506ae7b9 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -203,7 +203,7 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
* @elem_size: The size in bytes of the control.
* @new_elems: The number of elements in p_new. This is the same as @elems,
* except for dynamic arrays. In that case it is in the range of
- * 1 to @p_dyn_alloc_elems.
+ * 1 to @p_array_alloc_elems.
* @dims: The size of each dimension.
* @nr_of_dims:The number of dimensions in @dims.
* @menu_skip_mask: The control's skip mask for menu controls. This makes it
@@ -227,12 +227,11 @@ typedef void (*v4l2_ctrl_notify_fnc)(struct v4l2_ctrl *ctrl, void *priv);
* not freed when the control is deleted. Should this be needed
* then a new internal bitfield can be added to tell the framework
* to free this pointer.
- * @p_dyn: Pointer to the dynamically allocated array. Only valid if
- * @is_dyn_array is true.
- * @p_dyn_alloc_elems: The number of elements in the dynamically allocated
- * array for both the cur and new values. So @p_dyn is actually
- * sized for 2 * @p_dyn_alloc_elems * @elem_size. Only valid if
- * @is_dyn_array is true.
+ * @p_array: Pointer to the allocated array. Only valid if @is_array is true.
+ * @p_array_alloc_elems: The number of elements in the allocated
+ * array for both the cur and new values. So @p_array is actually
+ * sized for 2 * @p_array_alloc_elems * @elem_size. Only valid if
+ * @is_array is true.
* @cur: Structure to store the current value.
* @cur.val: The control's current value, if the @type is represented via
* a u32 integer (see &enum v4l2_ctrl_type).
@@ -291,8 +290,8 @@ struct v4l2_ctrl {
};
unsigned long flags;
void *priv;
- void *p_dyn;
- u32 p_dyn_alloc_elems;
+ void *p_array;
+ u32 p_array_alloc_elems;
s32 val;
struct {
s32 val;