From 571e148aaec20c26c308d6611cdb1f34ec81ff1e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 26 May 2018 20:58:19 +0300 Subject: configfs: Refactor ConfigFS parsing code Move all attribute parsing to a top-level configfs_parse_uvc() function, and split control and streaming interface attributes to two separate helper functions. In addition to making the code more structured, it will also allow supporting multiple streaming interfaces in a single UVC function in the future. The uvc_function_config structure is similarly reorganized in a hierarchical representation of the configuration. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- uvc-gadget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'uvc-gadget.c') diff --git a/uvc-gadget.c b/uvc-gadget.c index 96f9996..57dc097 100644 --- a/uvc-gadget.c +++ b/uvc-gadget.c @@ -414,9 +414,9 @@ uvc_events_process_class(struct uvc_device *dev, if ((ctrl->bRequestType & USB_RECIP_MASK) != USB_RECIP_INTERFACE) return; - if (interface == dev->fc->control_interface) + if (interface == dev->fc->control.intf.bInterfaceNumber) uvc_events_process_control(dev, ctrl->bRequest, ctrl->wValue >> 8, resp); - else if (interface == dev->fc->streaming_interface) + else if (interface == dev->fc->streaming.intf.bInterfaceNumber) uvc_events_process_streaming(dev, ctrl->bRequest, ctrl->wValue >> 8, resp); } -- cgit v1.2.3