Skip to content

Commit

Permalink
usb: gadget: core: fix bug when removing gadget drivers
Browse files Browse the repository at this point in the history
usb_gadget_disconnect() is responsible of removing
data pullups. Before doing that we must, first, tell
gadget driver we're disconnecting (by calling disconnect
method on gadget driver structure), unbind the gadget
driver and stop the controller.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Nov 14, 2011
1 parent 3c2d636 commit 6f39504
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/gadget/udc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
kobject_uevent(&udc->dev.kobj, KOBJ_CHANGE);

if (udc_is_newstyle(udc)) {
usb_gadget_disconnect(udc->gadget);
udc->driver->disconnect(udc->gadget);
udc->driver->unbind(udc->gadget);
usb_gadget_udc_stop(udc->gadget, udc->driver);

usb_gadget_disconnect(udc->gadget);
} else {
usb_gadget_stop(udc->gadget, udc->driver);
}
Expand Down

0 comments on commit 6f39504

Please sign in to comment.