[v4l-utils,v2,2/7] utils: media-ctl: Support changed routing API
Commit Message
From: Sakari Ailus <sakari.ailus@linux.intel.com>
Set len_routes of struct v4l2_subdev_routing. ENOSPC error code is no
longer used, i.e. having room for fewer routes than exist in the
configuration is not considered an error anymore.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
utils/media-ctl/libv4l2subdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
@@ -258,7 +258,7 @@ int v4l2_subdev_get_routing(struct media_entity *entity,
}
ret = ioctl(entity->fd, VIDIOC_SUBDEV_G_ROUTING, &routing);
- if (ret == -1 && errno != ENOSPC)
+ if (ret == -1)
return -errno;
if (!routing.num_routes) {
@@ -272,6 +272,7 @@ int v4l2_subdev_get_routing(struct media_entity *entity,
return -ENOMEM;
routing.routes = (uintptr_t)r;
+ routing.len_routes = routing.num_routes;
ret = ioctl(entity->fd, VIDIOC_SUBDEV_G_ROUTING, &routing);
if (ret) {
free(r);
@@ -292,6 +293,7 @@ int v4l2_subdev_set_routing(struct media_entity *entity,
.which = V4L2_SUBDEV_FORMAT_ACTIVE,
.routes = (uintptr_t)routes,
.num_routes = num_routes,
+ .len_routes = num_routes,
};
int ret;