summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/composite.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-06 20:11:04 +0200
committerFelipe Balbi <balbi@ti.com>2012-09-10 14:34:48 +0200
commit03e42bd5937c4c24e411690ab165627e93c258b5 (patch)
treeb28ce26b26167ceeb4d3dc83dc424fd2e2ecb973 /drivers/usb/gadget/composite.c
parentusb: gadget: push all usb_composite_driver structs into __refdata (diff)
downloadlinux-03e42bd5937c4c24e411690ab165627e93c258b5.tar.xz
linux-03e42bd5937c4c24e411690ab165627e93c258b5.zip
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>
Diffstat (limited to 'drivers/usb/gadget/composite.c')
-rw-r--r--drivers/usb/gadget/composite.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 402e5bd8b3e5..071d15c44116 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -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);
}