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 /include/linux/usb | |
| 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 'include/linux/usb')
| -rw-r--r-- | include/linux/usb/gadget.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index d3ef42d7d2f0..006412ce2303 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h | |||
| @@ -705,11 +705,6 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
| 705 | * struct usb_gadget_driver - driver for usb 'slave' devices | 705 | * struct usb_gadget_driver - driver for usb 'slave' devices |
| 706 | * @function: String describing the gadget's function | 706 | * @function: String describing the gadget's function |
| 707 | * @speed: Highest speed the driver handles. | 707 | * @speed: Highest speed the driver handles. |
| 708 | * @bind: Invoked when the driver is bound to a gadget, usually | ||
| 709 | * after registering the driver. | ||
| 710 | * At that point, ep0 is fully initialized, and ep_list holds | ||
| 711 | * the currently-available endpoints. | ||
| 712 | * Called in a context that permits sleeping. | ||
| 713 | * @setup: Invoked for ep0 control requests that aren't handled by | 708 | * @setup: Invoked for ep0 control requests that aren't handled by |
| 714 | * the hardware level driver. Most calls must be handled by | 709 | * the hardware level driver. Most calls must be handled by |
| 715 | * the gadget driver, including descriptor and configuration | 710 | * the gadget driver, including descriptor and configuration |
| @@ -774,7 +769,6 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) | |||
| 774 | struct usb_gadget_driver { | 769 | struct usb_gadget_driver { |
| 775 | char *function; | 770 | char *function; |
| 776 | enum usb_device_speed speed; | 771 | enum usb_device_speed speed; |
| 777 | int (*bind)(struct usb_gadget *); | ||
| 778 | void (*unbind)(struct usb_gadget *); | 772 | void (*unbind)(struct usb_gadget *); |
| 779 | int (*setup)(struct usb_gadget *, | 773 | int (*setup)(struct usb_gadget *, |
| 780 | const struct usb_ctrlrequest *); | 774 | const struct usb_ctrlrequest *); |
| @@ -798,17 +792,19 @@ struct usb_gadget_driver { | |||
| 798 | */ | 792 | */ |
| 799 | 793 | ||
| 800 | /** | 794 | /** |
| 801 | * usb_gadget_register_driver - register a gadget driver | 795 | * usb_gadget_probe_driver - probe a gadget driver |
| 802 | * @driver:the driver being registered | 796 | * @driver: the driver being registered |
| 797 | * @bind: the driver's bind callback | ||
| 803 | * Context: can sleep | 798 | * Context: can sleep |
| 804 | * | 799 | * |
| 805 | * Call this in your gadget driver's module initialization function, | 800 | * Call this in your gadget driver's module initialization function, |
| 806 | * to tell the underlying usb controller driver about your driver. | 801 | * to tell the underlying usb controller driver about your driver. |
| 807 | * The driver's bind() function will be called to bind it to a | 802 | * The @bind() function will be called to bind it to a gadget before this |
| 808 | * gadget before this registration call returns. It's expected that | 803 | * registration call returns. It's expected that the @bind() function will |
| 809 | * the bind() functions will be in init sections. | 804 | * be in init sections. |
| 810 | */ | 805 | */ |
| 811 | int usb_gadget_register_driver(struct usb_gadget_driver *driver); | 806 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
| 807 | int (*bind)(struct usb_gadget *)); | ||
| 812 | 808 | ||
| 813 | /** | 809 | /** |
| 814 | * usb_gadget_unregister_driver - unregister a gadget driver | 810 | * usb_gadget_unregister_driver - unregister a gadget driver |
