USB: support usb otg and host20 functions
[firefly-linux-kernel-4.4.55.git] / drivers / usb / gadget / composite.c
index 2dd57853de67360511a32946a93785165ebee46f..b331472cd307b659843d665eed35a2b3acf0cb29 100644 (file)
@@ -636,6 +636,9 @@ static int set_config(struct usb_composite_dev *cdev,
 
        cdev->config = c;
 
+       /* reset delay status to zero every time usb reconnect */
+       cdev->delayed_status = 0;
+
        /* Initialize all interfaces by setting them to altsetting zero. */
        for (tmp = 0; tmp < MAX_CONFIG_INTERFACES; tmp++) {
                struct usb_function     *f = c->interface[tmp];
@@ -1839,6 +1842,8 @@ void usb_composite_setup_continue(struct usb_composite_dev *cdev)
                        req->status = 0;
                        composite_setup_complete(cdev->gadget->ep0, req);
                }
+       }else{
+               WARN(cdev, "%s: Unexpected delayed status 0x%x\n", __func__, cdev->delayed_status);
        }
 
        spin_unlock_irqrestore(&cdev->lock, flags);