USB: gadget: atmel: disconnect before unbind
When unbind the gadget driver, need call disconnect first. Signed-off-by: Bo Shen <voice.shen@atmel.com>
This commit is contained in:
parent
a6921adcf2
commit
4585fc5863
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue