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/atmel_usba_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/atmel_usba_udc.c')
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index d623c7bda1f6..e4810c6a0b1f 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -1789,7 +1789,8 @@ out: | |||
1789 | return IRQ_HANDLED; | 1789 | return IRQ_HANDLED; |
1790 | } | 1790 | } |
1791 | 1791 | ||
1792 | int usb_gadget_register_driver(struct usb_gadget_driver *driver) | 1792 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
1793 | int (*bind)(struct usb_gadget *)) | ||
1793 | { | 1794 | { |
1794 | struct usba_udc *udc = &the_udc; | 1795 | struct usba_udc *udc = &the_udc; |
1795 | unsigned long flags; | 1796 | unsigned long flags; |
@@ -1812,7 +1813,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1812 | clk_enable(udc->pclk); | 1813 | clk_enable(udc->pclk); |
1813 | clk_enable(udc->hclk); | 1814 | clk_enable(udc->hclk); |
1814 | 1815 | ||
1815 | ret = driver->bind(&udc->gadget); | 1816 | ret = bind(&udc->gadget); |
1816 | if (ret) { | 1817 | if (ret) { |
1817 | DBG(DBG_ERR, "Could not bind to driver %s: error %d\n", | 1818 | DBG(DBG_ERR, "Could not bind to driver %s: error %d\n", |
1818 | driver->driver.name, ret); | 1819 | driver->driver.name, ret); |
@@ -1841,7 +1842,7 @@ err_driver_bind: | |||
1841 | udc->gadget.dev.driver = NULL; | 1842 | udc->gadget.dev.driver = NULL; |
1842 | return ret; | 1843 | return ret; |
1843 | } | 1844 | } |
1844 | EXPORT_SYMBOL(usb_gadget_register_driver); | 1845 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
1845 | 1846 | ||
1846 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 1847 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) |
1847 | { | 1848 | { |