mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-14 06:24:53 +08:00
usb: gadget: udc-core: initialize gadget->dev.driver
if we initialize gadget->dev.driver ourselves, UDC drivers won't have to do the same, so we can remove some duplicated code. Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
8a1c33075e
commit
70d3a49878
@ -247,6 +247,7 @@ static void usb_gadget_remove_driver(struct usb_udc *udc)
|
|||||||
|
|
||||||
udc->driver = NULL;
|
udc->driver = NULL;
|
||||||
udc->dev.driver = NULL;
|
udc->dev.driver = NULL;
|
||||||
|
udc->gadget->dev.driver = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -296,6 +297,7 @@ static int udc_bind_to_driver(struct usb_udc *udc, struct usb_gadget_driver *dri
|
|||||||
|
|
||||||
udc->driver = driver;
|
udc->driver = driver;
|
||||||
udc->dev.driver = &driver->driver;
|
udc->dev.driver = &driver->driver;
|
||||||
|
udc->gadget->dev.driver = &driver->driver;
|
||||||
|
|
||||||
ret = driver->bind(udc->gadget, driver);
|
ret = driver->bind(udc->gadget, driver);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -314,6 +316,7 @@ err1:
|
|||||||
udc->driver->function, ret);
|
udc->driver->function, ret);
|
||||||
udc->driver = NULL;
|
udc->driver = NULL;
|
||||||
udc->dev.driver = NULL;
|
udc->dev.driver = NULL;
|
||||||
|
udc->gadget->dev.driver = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user