aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/inode.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/inode.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/inode.c')
-rw-r--r--drivers/usb/gadget/inode.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/gadget/inode.c b/drivers/usb/gadget/inode.c
index fc35406fc80c..e2e8eda83f0d 100644
--- a/drivers/usb/gadget/inode.c
+++ b/drivers/usb/gadget/inode.c
@@ -1775,7 +1775,6 @@ static struct usb_gadget_driver gadgetfs_driver = {
1775 .speed = USB_SPEED_FULL, 1775 .speed = USB_SPEED_FULL,
1776#endif 1776#endif
1777 .function = (char *) driver_desc, 1777 .function = (char *) driver_desc,
1778 .bind = gadgetfs_bind,
1779 .unbind = gadgetfs_unbind, 1778 .unbind = gadgetfs_unbind,
1780 .setup = gadgetfs_setup, 1779 .setup = gadgetfs_setup,
1781 .disconnect = gadgetfs_disconnect, 1780 .disconnect = gadgetfs_disconnect,
@@ -1798,7 +1797,6 @@ static int gadgetfs_probe (struct usb_gadget *gadget)
1798 1797
1799static struct usb_gadget_driver probe_driver = { 1798static struct usb_gadget_driver probe_driver = {
1800 .speed = USB_SPEED_HIGH, 1799 .speed = USB_SPEED_HIGH,
1801 .bind = gadgetfs_probe,
1802 .unbind = gadgetfs_nop, 1800 .unbind = gadgetfs_nop,
1803 .setup = (void *)gadgetfs_nop, 1801 .setup = (void *)gadgetfs_nop,
1804 .disconnect = gadgetfs_nop, 1802 .disconnect = gadgetfs_nop,
@@ -1908,7 +1906,7 @@ dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
1908 1906
1909 /* triggers gadgetfs_bind(); then we can enumerate. */ 1907 /* triggers gadgetfs_bind(); then we can enumerate. */
1910 spin_unlock_irq (&dev->lock); 1908 spin_unlock_irq (&dev->lock);
1911 value = usb_gadget_register_driver (&gadgetfs_driver); 1909 value = usb_gadget_probe_driver(&gadgetfs_driver, gadgetfs_bind);
1912 if (value != 0) { 1910 if (value != 0) {
1913 kfree (dev->buf); 1911 kfree (dev->buf);
1914 dev->buf = NULL; 1912 dev->buf = NULL;
@@ -2047,7 +2045,7 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
2047 return -ESRCH; 2045 return -ESRCH;
2048 2046
2049 /* fake probe to determine $CHIP */ 2047 /* fake probe to determine $CHIP */
2050 (void) usb_gadget_register_driver (&probe_driver); 2048 (void) usb_gadget_probe_driver(&probe_driver, gadgetfs_probe);
2051 if (!CHIP) 2049 if (!CHIP)
2052 return -ENODEV; 2050 return -ENODEV;
2053 2051