summaryrefslogtreecommitdiff
path: root/include/linux/usb
diff options
context:
space:
mode:
authorRuslan Bilovol <ruslan.bilovol@gmail.com>2015-11-23 09:56:38 +0100
committerNitin Garg <nitin.garg@nxp.com>2016-01-14 11:03:02 -0600
commit1d1429fdd96d95cbdd696dbb80fa1af36cfe3dd7 (patch)
tree73ddb422dc8bf0e24ef95a8045d9d067a803f3fc /include/linux/usb
parenta55f8d6040a995dba0c969fff1d480e7bf204ade (diff)
usb: gadget: udc-core: independent registration of gadgets and gadget drivers
Change behavior during registration of gadgets and gadget drivers in udc-core. Instead of previous approach when for successful probe of usb gadget driver at least one usb gadget should be already registered use another one where gadget drivers and gadgets can be registered in udc-core independently. Independent registration of gadgets and gadget drivers is useful for built-in into kernel gadget and gadget driver case - because it's possible that gadget is really probed only on late_init stage (due to deferred probe) whereas gadget driver's probe is silently failed on module_init stage due to no any UDC added. Also it is useful for modules case - now there is no difference what module to insert first: gadget module or gadget driver one. Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> [simplified code as requested by Alan Stern and Felipe Balbi, fixed checkpatch issues] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Tested-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/gadget.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 99e3f9518c7c..dad590135988 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -829,6 +829,7 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
* @driver: Driver model state for this driver.
* @udc_name: A name of UDC this driver should be bound to. If udc_name is NULL,
* this driver will be bound to any available UDC.
+ * @pending: UDC core private data used for deferred probe of this driver.
*
* Devices are disabled till a gadget driver successfully bind()s, which
* means the driver will handle setup() requests needed to enumerate (and
@@ -891,6 +892,7 @@ struct usb_gadget_driver {
struct device_driver driver;
char *udc_name;
+ struct list_head pending;
};