From: Bo Shen Date: Tue, 24 Sep 2013 05:19:24 +0000 (+0800) Subject: USB: gadget: atmel: disconnect before unbind X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-logo.png?a=commitdiff_plain;h=4585fc58639757ee6f3a654697a9fb5763adffcd;p=u-boot.git USB: gadget: atmel: disconnect before unbind When unbind the gadget driver, need call disconnect first. Signed-off-by: Bo Shen --- diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index f146c48afa..c99208d102 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -1240,11 +1240,12 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) { struct usba_udc *udc = &controller; - if (!driver || !driver->bind || !driver->setup) { + if (!driver || !driver->unbind || !driver->disconnect) { error("bad paramter\n"); return -EINVAL; } + driver->disconnect(&udc->gadget); driver->unbind(&udc->gadget); udc->driver = NULL;