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/m66592-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/m66592-udc.c')
-rw-r--r-- | drivers/usb/gadget/m66592-udc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index e03058fe23cb..51b19f3027e7 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c | |||
@@ -1454,14 +1454,15 @@ static struct usb_ep_ops m66592_ep_ops = { | |||
1454 | /*-------------------------------------------------------------------------*/ | 1454 | /*-------------------------------------------------------------------------*/ |
1455 | static struct m66592 *the_controller; | 1455 | static struct m66592 *the_controller; |
1456 | 1456 | ||
1457 | int usb_gadget_register_driver(struct usb_gadget_driver *driver) | 1457 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
1458 | int (*bind)(struct usb_gadget *)) | ||
1458 | { | 1459 | { |
1459 | struct m66592 *m66592 = the_controller; | 1460 | struct m66592 *m66592 = the_controller; |
1460 | int retval; | 1461 | int retval; |
1461 | 1462 | ||
1462 | if (!driver | 1463 | if (!driver |
1463 | || driver->speed != USB_SPEED_HIGH | 1464 | || driver->speed != USB_SPEED_HIGH |
1464 | || !driver->bind | 1465 | || !bind |
1465 | || !driver->setup) | 1466 | || !driver->setup) |
1466 | return -EINVAL; | 1467 | return -EINVAL; |
1467 | if (!m66592) | 1468 | if (!m66592) |
@@ -1480,7 +1481,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1480 | goto error; | 1481 | goto error; |
1481 | } | 1482 | } |
1482 | 1483 | ||
1483 | retval = driver->bind (&m66592->gadget); | 1484 | retval = bind(&m66592->gadget); |
1484 | if (retval) { | 1485 | if (retval) { |
1485 | pr_err("bind to driver error (%d)\n", retval); | 1486 | pr_err("bind to driver error (%d)\n", retval); |
1486 | device_del(&m66592->gadget.dev); | 1487 | device_del(&m66592->gadget.dev); |
@@ -1505,7 +1506,7 @@ error: | |||
1505 | 1506 | ||
1506 | return retval; | 1507 | return retval; |
1507 | } | 1508 | } |
1508 | EXPORT_SYMBOL(usb_gadget_register_driver); | 1509 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
1509 | 1510 | ||
1510 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 1511 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) |
1511 | { | 1512 | { |