]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
media: v4l2-ctrls: Return handler error in creating new fwnode properties
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 12 Apr 2024 12:56:49 +0000 (15:56 +0300)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 22 Apr 2024 09:41:04 +0000 (11:41 +0200)
If the control handler is in an error state, return that error immediately
in v4l2_ctrl_new_fwnode_properties(). Effectively the change here is that
the same error code (handler's error) is returned in all cases instead of
possibly returning -EINVAL.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/v4l2-core/v4l2-ctrls-core.c

index 9a09a981e1d961b48a1069792340c8ff4305c2a4..c59dd691f79f6289d99b62a97906b25a7d1531f7 100644 (file)
@@ -2567,6 +2567,9 @@ int v4l2_ctrl_new_fwnode_properties(struct v4l2_ctrl_handler *hdl,
                                    const struct v4l2_ctrl_ops *ctrl_ops,
                                    const struct v4l2_fwnode_device_properties *p)
 {
+       if (hdl->error)
+               return hdl->error;
+
        if (p->orientation != V4L2_FWNODE_PROPERTY_UNSET) {
                u32 orientation_ctrl;