usb: gadget: set gadget state as configured
authorPeter Chen <peter.chen@freescale.com>
Tue, 29 Apr 2014 05:26:28 +0000 (13:26 +0800)
committerFelipe Balbi <balbi@ti.com>
Mon, 12 May 2014 17:34:46 +0000 (12:34 -0500)
Set gadget device state as configurated after set configuration
has finished.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/composite.c
drivers/usb/gadget/inode.c

index fab906429b80533fc18a965efa5b9eb504f46ea7..8060de6562cdba5dd09ed61ce1de853bcd6610ac 100644 (file)
@@ -634,6 +634,7 @@ static int set_config(struct usb_composite_dev *cdev,
        if (!c)
                goto done;
 
+       usb_gadget_set_state(gadget, USB_STATE_CONFIGURED);
        cdev->config = c;
 
        /* Initialize all interfaces by setting them to altsetting zero. */
index b5be6f0308c270f2a844db3f00e7884380e5c2e6..09e21517377c067c932ce4b46287c98d84039ab6 100644 (file)
@@ -1494,6 +1494,7 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
                 */
                if (value == 0) {
                        INFO (dev, "configuration #%d\n", dev->current_config);
+                       usb_gadget_set_state(gadget, USB_STATE_CONFIGURED);
                        if (dev->usermode_setup) {
                                dev->setup_can_stall = 0;
                                goto delegate;