usb gadget: don't save bind callback in struct usb_composite_driver
The bind function is most of the time only called at init time so there is no need to save a pointer to it in the composite driver structure. This fixes many section mismatches reported by modpost. Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b0fca50f5a
commit
07a18bd716
@ -248,11 +248,7 @@ int usb_add_config(struct usb_composite_dev *,
|
||||
* and language IDs provided in control requests
|
||||
* @needs_serial: set to 1 if the gadget needs userspace to provide
|
||||
* a serial number. If one is not provided, warning will be printed.
|
||||
* @bind: (REQUIRED) Used to allocate resources that are shared across the
|
||||
* whole device, such as string IDs, and add its configurations using
|
||||
* @usb_add_config(). This may fail by returning a negative errno
|
||||
* value; it should return zero on successful initialization.
|
||||
* @unbind: Reverses @bind(); called as a side effect of unregistering
|
||||
* @unbind: Reverses bind; called as a side effect of unregistering
|
||||
* this driver.
|
||||
* @disconnect: optional driver disconnect method
|
||||
* @suspend: Notifies when the host stops sending USB traffic,
|
||||
@ -263,7 +259,7 @@ int usb_add_config(struct usb_composite_dev *,
|
||||
* Devices default to reporting self powered operation. Devices which rely
|
||||
* on bus powered operation should report this in their @bind() method.
|
||||
*
|
||||
* Before returning from @bind, various fields in the template descriptor
|
||||
* Before returning from bind, various fields in the template descriptor
|
||||
* may be overridden. These include the idVendor/idProduct/bcdDevice values
|
||||
* normally to bind the appropriate host side driver, and the three strings
|
||||
* (iManufacturer, iProduct, iSerialNumber) normally used to provide user
|
||||
@ -279,12 +275,6 @@ struct usb_composite_driver {
|
||||
struct usb_gadget_strings **strings;
|
||||
unsigned needs_serial:1;
|
||||
|
||||
/* REVISIT: bind() functions can be marked __init, which
|
||||
* makes trouble for section mismatch analysis. See if
|
||||
* we can't restructure things to avoid mismatching...
|
||||
*/
|
||||
|
||||
int (*bind)(struct usb_composite_dev *);
|
||||
int (*unbind)(struct usb_composite_dev *);
|
||||
|
||||
void (*disconnect)(struct usb_composite_dev *);
|
||||
@ -294,8 +284,9 @@ struct usb_composite_driver {
|
||||
void (*resume)(struct usb_composite_dev *);
|
||||
};
|
||||
|
||||
extern int usb_composite_register(struct usb_composite_driver *);
|
||||
extern void usb_composite_unregister(struct usb_composite_driver *);
|
||||
extern int usb_composite_probe(struct usb_composite_driver *driver,
|
||||
int (*bind)(struct usb_composite_dev *cdev));
|
||||
extern void usb_composite_unregister(struct usb_composite_driver *driver);
|
||||
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user