summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2014-04-29 13:26:29 +0800
committerFelipe Balbi <balbi@ti.com>2014-05-12 12:34:47 -0500
commitb5fb8d0a40eb52039e8df6fadafa95ecdcdc3026 (patch)
treee5e4a70a4825d95da0e6cddffe69b8a8cbb8eb61 /drivers/usb/gadget
parent6027f3173e797bf27fc5053aa74c9f40f85538d8 (diff)
usb: udc-core: set gadget state as not attached after unloading module
Set gadget state as "not attached" after unloading gadget module, or its state will be unchanged after we unload gadget module. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/udc-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
index 27768a7d986a..b0d98172bc07 100644
--- a/drivers/usb/gadget/udc-core.c
+++ b/drivers/usb/gadget/udc-core.c
@@ -428,6 +428,8 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
list_for_each_entry(udc, &udc_list, list)
if (udc->driver == driver) {
usb_gadget_remove_driver(udc);
+ usb_gadget_set_state(udc->gadget,
+ USB_STATE_NOTATTACHED);
ret = 0;
break;
}