usb: gadget: Handle function control requests before set config
some function drivers receive control requests before configuration is
selected, which are not being handled due to configuratiopn checks in
android gadget driver, which is resulting in stall on control endpoint.
Fix this issue, by removing the configuration checks, so that function
driver control requests are handled properly.
Change-Id: I90975bb6a7c0201de7715932469c603fea6954af
Signed-off-by: Chiranjeevi Velempati <cvelempa@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index 64f4657..da3bf5a 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -2329,15 +2329,12 @@
gadget->ep0->driver_data = cdev;
list_for_each_entry(conf, &dev->configs, list_item)
- if (&conf->usb_config == cdev->config)
- list_for_each_entry(f,
- &conf->enabled_functions,
- enabled_list)
- if (f->ctrlrequest) {
- value = f->ctrlrequest(f, cdev, c);
- if (value >= 0)
- break;
- }
+ list_for_each_entry(f, &conf->enabled_functions, enabled_list)
+ if (f->ctrlrequest) {
+ value = f->ctrlrequest(f, cdev, c);
+ if (value >= 0)
+ break;
+ }
/* Special case the accessory function.
* It needs to handle control requests before it is enabled.