summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Scally <dan.scally@ideasonboard.com>2022-08-22 11:54:17 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-11-17 23:38:14 +0000
commit75c224d8963b0d1b42fb0b7e7634c3513cf52481 (patch)
tree6326c0a4b31cff582465b313d90b649013fca410
parent309af54c6fcbd00350af4f60f84994fbbaf785f5 (diff)
lib: configfs: Use wildcard in path to gadget device
At some point the kernel has been updated to include a .id descriptor in the gadget directory name - add that to uvc_find_video_device() so that the video node is located properly. Rather than hardcode a specific gadget (for instance with device name gadget.0) use a wildcard. This has the advantage of backwards compatability with older kernels that did not use the ID as part of the device name, though still limits us to supporting scenarios where only a single gadget is bound to the UDC. Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
-rw-r--r--lib/configfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/configfs.c b/lib/configfs.c
index 26a07bb..a29e576 100644
--- a/lib/configfs.c
+++ b/lib/configfs.c
@@ -204,7 +204,7 @@ static char *udc_find_video_device(const char *udc, const char *function)
int ret;
ret = asprintf(&vpath,
- "/sys/class/udc/%s/device/gadget/video4linux/video*",
+ "/sys/class/udc/%s/device/gadget*/video4linux/video*",
udc ? udc : "*");
if (!ret)
return NULL;