aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/ci13xxx_udc.c
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-08-12 11:43:53 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:21:25 -0400
commitb0fca50f5a94a268ed02cfddf44448051ed9343f (patch)
treebc398947bcf6355f05ec33e4fea6a0b1927384ac /drivers/usb/gadget/ci13xxx_udc.c
parente12995ec8f8d99f2a339541fc28998af2d60af0f (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/ci13xxx_udc.c')
-rw-r--r--drivers/usb/gadget/ci13xxx_udc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/gadget/ci13xxx_udc.c
index 699695128e33..98b36fc88c77 100644
--- a/drivers/usb/gadget/ci13xxx_udc.c
+++ b/drivers/usb/gadget/ci13xxx_udc.c
@@ -2340,12 +2340,15 @@ static const struct usb_ep_ops usb_ep_ops = {
2340static const struct usb_gadget_ops usb_gadget_ops; 2340static const struct usb_gadget_ops usb_gadget_ops;
2341 2341
2342/** 2342/**
2343 * usb_gadget_register_driver: register a gadget driver 2343 * usb_gadget_probe_driver: register a gadget driver
2344 * @driver: the driver being registered
2345 * @bind: the driver's bind callback
2344 * 2346 *
2345 * Check usb_gadget_register_driver() at "usb_gadget.h" for details 2347 * Check usb_gadget_probe_driver() at <linux/usb/gadget.h> for details.
2346 * Interrupts are enabled here 2348 * Interrupts are enabled here.
2347 */ 2349 */
2348int usb_gadget_register_driver(struct usb_gadget_driver *driver) 2350int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
2351 int (*bind)(struct usb_gadget *))
2349{ 2352{
2350 struct ci13xxx *udc = _udc; 2353 struct ci13xxx *udc = _udc;
2351 unsigned long i, k, flags; 2354 unsigned long i, k, flags;
@@ -2354,7 +2357,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
2354 trace("%p", driver); 2357 trace("%p", driver);
2355 2358
2356 if (driver == NULL || 2359 if (driver == NULL ||
2357 driver->bind == NULL || 2360 bind == NULL ||
2358 driver->unbind == NULL || 2361 driver->unbind == NULL ||
2359 driver->setup == NULL || 2362 driver->setup == NULL ||
2360 driver->disconnect == NULL || 2363 driver->disconnect == NULL ||
@@ -2430,7 +2433,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
2430 udc->gadget.dev.driver = &driver->driver; 2433 udc->gadget.dev.driver = &driver->driver;
2431 2434
2432 spin_unlock_irqrestore(udc->lock, flags); 2435 spin_unlock_irqrestore(udc->lock, flags);
2433 retval = driver->bind(&udc->gadget); /* MAY SLEEP */ 2436 retval = bind(&udc->gadget); /* MAY SLEEP */
2434 spin_lock_irqsave(udc->lock, flags); 2437 spin_lock_irqsave(udc->lock, flags);
2435 2438
2436 if (retval) { 2439 if (retval) {
@@ -2447,7 +2450,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
2447 usb_gadget_unregister_driver(driver); 2450 usb_gadget_unregister_driver(driver);
2448 return retval; 2451 return retval;
2449} 2452}
2450EXPORT_SYMBOL(usb_gadget_register_driver); 2453EXPORT_SYMBOL(usb_gadget_probe_driver);
2451 2454
2452/** 2455/**
2453 * usb_gadget_unregister_driver: unregister a gadget driver 2456 * usb_gadget_unregister_driver: unregister a gadget driver
@@ -2462,7 +2465,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
2462 trace("%p", driver); 2465 trace("%p", driver);
2463 2466
2464 if (driver == NULL || 2467 if (driver == NULL ||
2465 driver->bind == NULL ||
2466 driver->unbind == NULL || 2468 driver->unbind == NULL ||
2467 driver->setup == NULL || 2469 driver->setup == NULL ||
2468 driver->disconnect == NULL || 2470 driver->disconnect == NULL ||