aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2012-09-06 14:11:05 -0400
committerFelipe Balbi <balbi@ti.com>2012-09-10 08:35:16 -0400
commit93952956c7078eb41058c5ccc5b34ae6cf59bb64 (patch)
tree99f00baae3db9f776e8518525502a464f5a9c4f4 /include/linux/usb
parent03e42bd5937c4c24e411690ab165627e93c258b5 (diff)
usb: gadget: move bind() callback back to struct usb_gadget_driver
This partly reverts 07a18bd7 ("usb gadget: don't save bind callback in struct usb_composite_driver") and fixes new drivers. The section missmatch problems was solved by whitelisting bind callback in modpost. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/gadget.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index d05b220f0fd3..9eb4e712168f 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -766,6 +766,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
766 * when the host is disconnected. May be called in_interrupt; this 766 * when the host is disconnected. May be called in_interrupt; this
767 * may not sleep. Some devices can't detect disconnect, so this might 767 * may not sleep. Some devices can't detect disconnect, so this might
768 * not be called except as part of controller shutdown. 768 * not be called except as part of controller shutdown.
769 * @bind: the driver's bind callback
769 * @unbind: Invoked when the driver is unbound from a gadget, 770 * @unbind: Invoked when the driver is unbound from a gadget,
770 * usually from rmmod (after a disconnect is reported). 771 * usually from rmmod (after a disconnect is reported).
771 * Called in a context that permits sleeping. 772 * Called in a context that permits sleeping.
@@ -820,6 +821,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
820struct usb_gadget_driver { 821struct usb_gadget_driver {
821 char *function; 822 char *function;
822 enum usb_device_speed max_speed; 823 enum usb_device_speed max_speed;
824 int (*bind)(struct usb_gadget *gadget);
823 void (*unbind)(struct usb_gadget *); 825 void (*unbind)(struct usb_gadget *);
824 int (*setup)(struct usb_gadget *, 826 int (*setup)(struct usb_gadget *,
825 const struct usb_ctrlrequest *); 827 const struct usb_ctrlrequest *);
@@ -845,7 +847,6 @@ struct usb_gadget_driver {
845/** 847/**
846 * usb_gadget_probe_driver - probe a gadget driver 848 * usb_gadget_probe_driver - probe a gadget driver
847 * @driver: the driver being registered 849 * @driver: the driver being registered
848 * @bind: the driver's bind callback
849 * Context: can sleep 850 * Context: can sleep
850 * 851 *
851 * Call this in your gadget driver's module initialization function, 852 * Call this in your gadget driver's module initialization function,
@@ -854,8 +855,7 @@ struct usb_gadget_driver {
854 * registration call returns. It's expected that the @bind() function will 855 * registration call returns. It's expected that the @bind() function will
855 * be in init sections. 856 * be in init sections.
856 */ 857 */
857int usb_gadget_probe_driver(struct usb_gadget_driver *driver, 858int usb_gadget_probe_driver(struct usb_gadget_driver *driver);
858 int (*bind)(struct usb_gadget *));
859 859
860/** 860/**
861 * usb_gadget_unregister_driver - unregister a gadget driver 861 * usb_gadget_unregister_driver - unregister a gadget driver