diff mbox series

[v4l-utils,3/3] v4l2-compliance: Account for ancillary links

Message ID 20211213234258.41411-4-djrscally@gmail.com (mailing list archive)
State New, archived
Headers show
Series Support ancillary links | expand

Commit Message

Daniel Scally Dec. 13, 2021, 11:42 p.m. UTC
Update v4l2-compliance to account for ancillary links, since there
are a couple of places in it that explicitly assume only two types
of links exist.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
---
 utils/v4l2-compliance/v4l2-test-media.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp
index 28af0d83..85b1eab5 100644
--- a/utils/v4l2-compliance/v4l2-test-media.cpp
+++ b/utils/v4l2-compliance/v4l2-test-media.cpp
@@ -261,7 +261,8 @@  int testMediaTopology(struct node *node)
 
 	for (unsigned i = 0; i < topology.num_links; i++) {
 		media_v2_link &link = v2_links[i];
-		bool is_iface = link.flags & MEDIA_LNK_FL_LINK_TYPE;
+		bool is_iface = (link.flags & MEDIA_LNK_FL_LINK_TYPE) ==
+				MEDIA_LNK_FL_INTERFACE_LINK ? true : false;
 
 		fail_on_test(check_0(link.reserved, sizeof(link.reserved)));
 		fail_on_test(!link.id);
@@ -460,7 +461,8 @@  int testMediaEnum(struct node *node)
 				link_disabled = links.links[i];
 
 			// This ioctl only returns data links
-			fail_on_test(fl & MEDIA_LNK_FL_LINK_TYPE);
+			fail_on_test((fl & MEDIA_LNK_FL_LINK_TYPE) !=
+				     MEDIA_LNK_FL_DATA_LINK);
 			fail_on_test(links.links[i].sink.entity == links.links[i].source.entity);
 			if (is_sink) {
 				fail_on_test(links.links[i].sink.index >= ent.pads);