From: Peter Chen Date: Tue, 29 Apr 2014 05:26:29 +0000 (+0800) Subject: usb: udc-core: set gadget state as not attached after unloading module X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b5fb8d0a40eb52039e8df6fadafa95ecdcdc3026;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Felipe Balbi --- 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; }