From: 黄涛 Date: Sat, 30 Jul 2011 14:48:45 +0000 (+0800) Subject: Revert "USB: composite: Fix USB WHQL Certification Issues" X-Git-Tag: firefly_0821_release~9919 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=96085cef9292ec235a02382ec515c936260b9f58;p=firefly-linux-kernel-4.4.55.git Revert "USB: composite: Fix USB WHQL Certification Issues" This reverts commit 7558ae6cd0d401b863f8f8d63fee12348270d045. --- diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 7e2dacc7974d..9c333f1cc62a 100755 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -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; - value = min(w_length, (u16) 1); - } else + else *(u8 *)req->buf = 0; + value = min(w_length, (u16) 1); break; /* function drivers must handle get/set altsetting; if there's @@ -819,9 +819,6 @@ 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);