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/omap_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/omap_udc.c')
-rw-r--r-- | drivers/usb/gadget/omap_udc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index f81e4f025f23..61d3ca6619bb 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c | |||
@@ -2102,7 +2102,8 @@ static inline int machine_without_vbus_sense(void) | |||
2102 | ); | 2102 | ); |
2103 | } | 2103 | } |
2104 | 2104 | ||
2105 | int usb_gadget_register_driver (struct usb_gadget_driver *driver) | 2105 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
2106 | int (*bind)(struct usb_gadget *)) | ||
2106 | { | 2107 | { |
2107 | int status = -ENODEV; | 2108 | int status = -ENODEV; |
2108 | struct omap_ep *ep; | 2109 | struct omap_ep *ep; |
@@ -2114,8 +2115,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
2114 | if (!driver | 2115 | if (!driver |
2115 | // FIXME if otg, check: driver->is_otg | 2116 | // FIXME if otg, check: driver->is_otg |
2116 | || driver->speed < USB_SPEED_FULL | 2117 | || driver->speed < USB_SPEED_FULL |
2117 | || !driver->bind | 2118 | || !bind || !driver->setup) |
2118 | || !driver->setup) | ||
2119 | return -EINVAL; | 2119 | return -EINVAL; |
2120 | 2120 | ||
2121 | spin_lock_irqsave(&udc->lock, flags); | 2121 | spin_lock_irqsave(&udc->lock, flags); |
@@ -2145,7 +2145,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
2145 | if (udc->dc_clk != NULL) | 2145 | if (udc->dc_clk != NULL) |
2146 | omap_udc_enable_clock(1); | 2146 | omap_udc_enable_clock(1); |
2147 | 2147 | ||
2148 | status = driver->bind (&udc->gadget); | 2148 | status = bind(&udc->gadget); |
2149 | if (status) { | 2149 | if (status) { |
2150 | DBG("bind to %s --> %d\n", driver->driver.name, status); | 2150 | DBG("bind to %s --> %d\n", driver->driver.name, status); |
2151 | udc->gadget.dev.driver = NULL; | 2151 | udc->gadget.dev.driver = NULL; |
@@ -2186,7 +2186,7 @@ done: | |||
2186 | omap_udc_enable_clock(0); | 2186 | omap_udc_enable_clock(0); |
2187 | return status; | 2187 | return status; |
2188 | } | 2188 | } |
2189 | EXPORT_SYMBOL(usb_gadget_register_driver); | 2189 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
2190 | 2190 | ||
2191 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) | 2191 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver) |
2192 | { | 2192 | { |