mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-18 11:17:07 +00:00
media: v4l2-ctrl: Add new helper v4l2_ctrl_ptr_create
This helper function simplifies the code by not needing a union v4l2_ctrl_ptr and an assignment every time we need to use a ctrl_ptr. Suggested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Ricardo Ribalda Delgado <ribalda@kernel.org> 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
3f0a700624
commit
2e8db63e1f
@ -73,6 +73,18 @@ union v4l2_ctrl_ptr {
|
||||
void *p;
|
||||
};
|
||||
|
||||
/**
|
||||
* v4l2_ctrl_ptr_create() - Helper function to return a v4l2_ctrl_ptr from a
|
||||
* void pointer
|
||||
* @ptr: The void pointer
|
||||
*/
|
||||
static inline union v4l2_ctrl_ptr v4l2_ctrl_ptr_create(void *ptr)
|
||||
{
|
||||
union v4l2_ctrl_ptr p = { .p = ptr };
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/**
|
||||
* struct v4l2_ctrl_ops - The control operations that the driver has to provide.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user