diff options
| author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2025-06-19 12:21:51 +0300 |
|---|---|---|
| committer | Hans Verkuil <hverkuil@xs4all.nl> | 2025-06-30 08:47:41 +0200 |
| commit | 04f541cef2dba78b17c83ad8b5a0742012399530 (patch) | |
| tree | 9f21e95f30bf6004907486cd2f2877f6cf5e1879 /include/media | |
| parent | 5a0400aca5fa7c6b8ba456c311a460e733571c88 (diff) | |
media: v4l2-ctrls: Return the handler's error in v4l2_ctrl_handler_free()
v4l2_ctrl_handler_free() used to return void but changing this to int,
returning the handler's error code, enables the drivers to simply return
the handler's error in this common error handling pattern:
if (handler->error)
return v4l2_ctrl_handler_free(handler);
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'include/media')
| -rw-r--r-- | include/media/v4l2-ctrls.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 3a87096e064f..c32c46286441 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -579,8 +579,10 @@ int v4l2_ctrl_handler_init_class(struct v4l2_ctrl_handler *hdl, * @hdl: The control handler. * * Does nothing if @hdl == NULL. + * + * Return: @hdl's error field or 0 if @hdl is NULL. */ -void v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl); +int v4l2_ctrl_handler_free(struct v4l2_ctrl_handler *hdl); /** * v4l2_ctrl_lock() - Helper function to lock the handler |