aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2025-11-11 13:07:29 +0200
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-01-14 23:33:02 +0100
commite3d5436c7099881e3604826757c8d65acc2d94f3 (patch)
tree8358302d88b7b426cde869a14f7366036c92e16d /include
parent2759816f1682ca6a269064b7b9d50a65bc3afd5d (diff)
media: v4l2-ctrls: Set error v4l2_ctrl_new_fwnode_properties consistently
The vast majority of the callers of v4l2_ctrl_new_fwnode_properties() do check the returned error code but the function does not set the control handler's error on failure. This will make error handling more complicated and prone for bugs. Always assign the control handler's error field on error in v4l2_ctrl_new_fwnode_properties(). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/media/v4l2-ctrls.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 31fc1bee3797..327976b14d50 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -1581,6 +1581,9 @@ int v4l2_ctrl_subdev_log_status(struct v4l2_subdev *sd);
* not overwritten. Callers should register the controls they want to handle
* themselves before calling this function.
*
+ * This function will set the control handler's error field on failure, just as
+ * other functions adding controls to the handler.
+ *
* Return: 0 on success, a negative error code on failure.
*/
int v4l2_ctrl_new_fwnode_properties(struct v4l2_ctrl_handler *hdl,