[PATCH v12 31/86] media: v4l2-subdev: Set STATIC route flag if IMMUTABLE route flag is set

Sakari Ailus
2026-04-09T20:15:29Z

As the IMMUTABLE sub-device route flag implies the STATIC flag, do set the
STATIC flag for all IMMUTABLE routes returned to the user space.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
drivers/media/v4l2-core/v4l2-subdev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 4b7830f705a2..3f671282ee91 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -698,8 +698,11 @@ static void copy_routes_state_to_routing(struct v4l2_subdev_routing *routing,
(struct v4l2_subdev_route *)(uintptr_t)routing->routes;
u32 copy_routes = min(routing->len_routes, state->routing.num_routes);

- for (u32 i = 0; i < copy_routes; i++)
+ for (u32 i = 0; i < copy_routes; i++) {
routes[i] = state->routing.routes[i];
+ if (routes[i].flags & V4L2_SUBDEV_ROUTE_FL_IMMUTABLE)
+ routes[i].flags |= V4L2_SUBDEV_ROUTE_FL_STATIC;
+ }

routing->num_routes = state->routing.num_routes;
}
--
2.47.3