From: Felipe Balbi Date: Fri, 10 Oct 2014 20:24:00 +0000 (-0500) Subject: usb: dwc3: gadget: set state to NOT_ATTACHED on disconnect_irq X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=06a374ed13fdb7c6b2edd8cbdcf52bd1b0cc67b9;p=openwrt%2Fstaging%2Fblogic.git usb: dwc3: gadget: set state to NOT_ATTACHED on disconnect_irq whenever we get a Disconnect Interrupt, we should make sure to update out udc state to NOT_ATTACHED, otherwise sysfs will show wrong values. Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 748b87b3f98a..12f42842da10 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2140,6 +2140,7 @@ static void dwc3_gadget_disconnect_interrupt(struct dwc3 *dwc) dwc->gadget.speed = USB_SPEED_UNKNOWN; dwc->setup_packet_pending = false; + usb_gadget_set_state(&dwc->gadget, USB_STATE_NOTATTACHED); } static void dwc3_gadget_reset_interrupt(struct dwc3 *dwc)