mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
USB: composite: Fix USB WHQL Certification Issues
Submitted on behalf of RaviKumar Vembu <ravi.v@motorola.com> Signed-off-by: Jared Suttles <jared.suttles@motorola.com> Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
committed by
Arve Hjønnevåg
parent
5502501ffd
commit
7558ae6cd0
@@ -765,11 +765,11 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
||||
case USB_REQ_GET_CONFIGURATION:
|
||||
if (ctrl->bRequestType != USB_DIR_IN)
|
||||
goto unknown;
|
||||
if (cdev->config)
|
||||
if (cdev->config) {
|
||||
*(u8 *)req->buf = cdev->config->bConfigurationValue;
|
||||
else
|
||||
value = min(w_length, (u16) 1);
|
||||
} else
|
||||
*(u8 *)req->buf = 0;
|
||||
value = min(w_length, (u16) 1);
|
||||
break;
|
||||
|
||||
/* function drivers must handle get/set altsetting; if there's
|
||||
@@ -819,6 +819,9 @@ unknown:
|
||||
*/
|
||||
if ((ctrl->bRequestType & USB_RECIP_MASK)
|
||||
== USB_RECIP_INTERFACE) {
|
||||
if (cdev->config == NULL)
|
||||
return value;
|
||||
|
||||
f = cdev->config->interface[intf];
|
||||
if (f && f->setup)
|
||||
value = f->setup(f, ctrl);
|
||||
|
||||
Reference in New Issue
Block a user