Commit 4585fc58 authored by Bo Shen's avatar Bo Shen Committed by Marek Vasut
Browse files

USB: gadget: atmel: disconnect before unbind



When unbind the gadget driver, need call disconnect first.
Signed-off-by: default avatarBo Shen <voice.shen@atmel.com>
parent a6921adc
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment