Merge remote-tracking branch 'usb-gadget/next'
[deliverable/linux.git] / drivers / usb / gadget / composite.c
index 5ebe6af7976ec4189363651dfe505cf6ec79fb12..32176f779861624578b47be6dd4975a269b7f664 100644 (file)
@@ -1893,17 +1893,21 @@ unknown:
                /* functions always handle their interfaces and endpoints...
                 * punt other recipients (other, WUSB, ...) to the current
                 * configuration code.
-                *
-                * REVISIT it could make sense to let the composite device
-                * take such requests too, if that's ever needed:  to work
-                * in config 0, etc.
                 */
                if (cdev->config) {
                        list_for_each_entry(f, &cdev->config->functions, list)
-                               if (f->req_match && f->req_match(f, ctrl))
+                               if (f->req_match &&
+                                   f->req_match(f, ctrl, false))
                                        goto try_fun_setup;
-                       f = NULL;
+               } else {
+                       struct usb_configuration *c;
+                       list_for_each_entry(c, &cdev->configs, list)
+                               list_for_each_entry(f, &c->functions, list)
+                                       if (f->req_match &&
+                                           f->req_match(f, ctrl, true))
+                                               goto try_fun_setup;
                }
+               f = NULL;
 
                switch (ctrl->bRequestType & USB_RECIP_MASK) {
                case USB_RECIP_INTERFACE:
This page took 0.023942 seconds and 5 git commands to generate.