diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-08-12 11:43:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:21:25 -0400 |
commit | b0fca50f5a94a268ed02cfddf44448051ed9343f (patch) | |
tree | bc398947bcf6355f05ec33e4fea6a0b1927384ac /drivers/usb/gadget/goku_udc.c | |
parent | e12995ec8f8d99f2a339541fc28998af2d60af0f (diff) |
usb gadget: don't save bind callback in struct usb_gadget_driver
To accomplish this the function to register a gadget driver takes the bind
function as a second argument. To make things clearer rename the function
to resemble platform_driver_probe.
This fixes many section mismatches like
WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch in
reference from the variable printer_driver to the function
.init.text:printer_bind()
The variable printer_driver references
the function __init printer_bind()
All callers are fixed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[m.nazarewicz@samsung.com: added dbgp]
Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/goku_udc.c')
-rw-r--r-- | drivers/usb/gadget/goku_udc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index 1088d08c7ed8..49fbd4dbeb94 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -1343,14 +1343,15 @@ static struct goku_udc *the_controller; | |||
1343 | * disconnect is reported. then a host may connect again, or | 1343 | * disconnect is reported. then a host may connect again, or |
1344 | * the driver might get unbound. | 1344 | * the driver might get unbound. |
1345 | */ | 1345 | */ |
1346 | int usb_gadget_register_driver(struct usb_gadget_driver *driver) | 1346 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
1347 | int (*bind)(struct usb_gadget *)) | ||
1347 | { | 1348 | { |
1348 | struct goku_udc *dev = the_controller; | 1349 | struct goku_udc *dev = the_controller; |
1349 | int retval; | 1350 | int retval; |
1350 | 1351 | ||
1351 | if (!driver | 1352 | if (!driver |
1352 | || driver->speed < USB_SPEED_FULL | 1353 | || driver->speed < USB_SPEED_FULL |
1353 | || !driver->bind | 1354 | || !bind |
1354 | || !driver->disconnect | 1355 | || !driver->disconnect |
1355 | || !driver->setup) | 1356 | || !driver->setup) |
1356 | return -EINVAL; | 1357 | return -EINVAL; |
@@ -1363,7 +1364,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1363 | driver->driver.bus = NULL; | 1364 | driver->driver.bus = NULL; |
1364 | dev->driver = driver; | 1365 | dev->driver = driver; |
1365 | dev->gadget.dev.driver = &driver->driver; | 1366 | dev->gadget.dev.driver = &driver->driver; |
1366 | retval = driver->bind(&dev->gadget); | 1367 | retval = bind(&dev->gadget); |
1367 | if (retval) { | 1368 | if (retval) { |
1368 | DBG(dev, "bind to driver %s --> error %d\n", | 1369 | DBG(dev, "bind to driver %s --> error %d\n", |
1369 | driver->driver.name, retval); | 1370 | driver->driver.name, retval); |
@@ -1380,7 +1381,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1380 | DBG(dev, "registered gadget driver '%s'\n", driver->driver.name); | 1381 | DBG(dev, "registered gadget driver '%s'\n", driver->driver.name); |
1381 | return 0; | 1382 | return 0; |
1382 | } | 1383 | } |
1383 | EXPORT_SYMBOL(usb_gadget_register_driver); | 1384 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
1384 | 1385 | ||
1385 | static void | 1386 | static void |
1386 | stop_activity(struct goku_udc *dev, struct usb_gadget_driver *driver) | 1387 | stop_activity(struct goku_udc *dev, struct usb_gadget_driver *driver) |