diff options
author | Bo Shen <voice.shen@atmel.com> | 2013-09-24 13:19:24 +0800 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2013-09-24 17:51:36 +0200 |
commit | 4585fc58639757ee6f3a654697a9fb5763adffcd (patch) | |
tree | ca04b0fe896432ca07ce382351a934ecbb49d1c2 | |
parent | a6921adcf200b3f2b6fadd78f99ea99b0f362e9c (diff) | |
download | u-boot-imx-4585fc58639757ee6f3a654697a9fb5763adffcd.zip u-boot-imx-4585fc58639757ee6f3a654697a9fb5763adffcd.tar.gz u-boot-imx-4585fc58639757ee6f3a654697a9fb5763adffcd.tar.bz2 |
USB: gadget: atmel: disconnect before unbind
When unbind the gadget driver, need call disconnect first.
Signed-off-by: Bo Shen <voice.shen@atmel.com>
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index f146c48..c99208d 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; |