usb: gadget: move bind() callback back to struct usb_composite_driver

This partly reverts 07a18bd7 ("usb gadget: don't save bind callback in
struct usb_composite_driver") and fixes new drivers. The section missmatch
problems was solved by whitelisting structs in question via __ref.

Cc: devel@driverdev.osuosl.org
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Sebastian Andrzej Siewior
2012-09-06 20:11:04 +02:00
committed by Felipe Balbi
parent c2ec75c251
commit 03e42bd593
19 changed files with 37 additions and 26 deletions

View File

@@ -1617,12 +1617,9 @@ static struct usb_gadget_driver composite_driver = {
* while it was binding. That would usually be done in order to wait for
* some userspace participation.
*/
int usb_composite_probe(struct usb_composite_driver *driver,
int (*bind)(struct usb_composite_dev *cdev))
int usb_composite_probe(struct usb_composite_driver *driver)
{
if (!driver || !driver->dev || composite)
return -EINVAL;
if (!bind && !driver->bind)
if (!driver || !driver->dev || composite || !driver->bind)
return -EINVAL;
if (!driver->name)
@@ -1633,8 +1630,6 @@ int usb_composite_probe(struct usb_composite_driver *driver,
composite_driver.driver.name = driver->name;
composite_driver.max_speed = driver->max_speed;
composite = driver;
if (!driver->bind)
driver->bind = bind;
return usb_gadget_probe_driver(&composite_driver, composite_bind);
}