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/printer.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/printer.c')
-rw-r--r-- | drivers/usb/gadget/printer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/gadget/printer.c b/drivers/usb/gadget/printer.c index 04c7bbf121af..ded080a1c8ce 100644 --- a/drivers/usb/gadget/printer.c +++ b/drivers/usb/gadget/printer.c | |||
@@ -1543,7 +1543,6 @@ static struct usb_gadget_driver printer_driver = { | |||
1543 | .speed = DEVSPEED, | 1543 | .speed = DEVSPEED, |
1544 | 1544 | ||
1545 | .function = (char *) driver_desc, | 1545 | .function = (char *) driver_desc, |
1546 | .bind = printer_bind, | ||
1547 | .unbind = printer_unbind, | 1546 | .unbind = printer_unbind, |
1548 | 1547 | ||
1549 | .setup = printer_setup, | 1548 | .setup = printer_setup, |
@@ -1579,11 +1578,11 @@ init(void) | |||
1579 | return status; | 1578 | return status; |
1580 | } | 1579 | } |
1581 | 1580 | ||
1582 | status = usb_gadget_register_driver(&printer_driver); | 1581 | status = usb_gadget_probe_driver(&printer_driver, printer_bind); |
1583 | if (status) { | 1582 | if (status) { |
1584 | class_destroy(usb_gadget_class); | 1583 | class_destroy(usb_gadget_class); |
1585 | unregister_chrdev_region(g_printer_devno, 1); | 1584 | unregister_chrdev_region(g_printer_devno, 1); |
1586 | DBG(dev, "usb_gadget_register_driver %x\n", status); | 1585 | DBG(dev, "usb_gadget_probe_driver %x\n", status); |
1587 | } | 1586 | } |
1588 | 1587 | ||
1589 | return status; | 1588 | return status; |