summaryrefslogtreecommitdiff
path: root/include/linux/usb
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2015-03-06 10:36:02 +0800
committerFelipe Balbi <balbi@ti.com>2015-03-19 11:25:46 -0500
commitdfea9c94837d27e38c8cc85a3c1c7c268973c3c2 (patch)
treeb4f76788c83c4a0a8ae8e01e349e02055eb01bf9 /include/linux/usb
parent7252f1bfd4bc97ec4b5fa7adaf3a1a45c325635c (diff)
usb: udc: store usb_udc pointer in struct usb_gadget
Instead of iterate to find usb_udc according to usb_gadget, this way is easier. Alan Stern suggests this way too: http://marc.info/?l=linux-usb&m=142168496528894&w=2 Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-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.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 02476b3a1109..242c694a5b85 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -474,6 +474,7 @@ struct usb_dcd_config_params {
struct usb_gadget;
struct usb_gadget_driver;
+struct usb_udc;
/* the rest of the api to the controller hardware: device operations,
* which don't involve endpoints (or i/o).
@@ -496,6 +497,7 @@ struct usb_gadget_ops {
/**
* struct usb_gadget - represents a usb slave device
* @work: (internal use) Workqueue to be used for sysfs_notify()
+ * @udc: struct usb_udc pointer for this gadget
* @ops: Function pointers used to access hardware-specific operations.
* @ep0: Endpoint zero, used when reading or writing responses to
* driver setup() requests
@@ -545,6 +547,7 @@ struct usb_gadget_ops {
*/
struct usb_gadget {
struct work_struct work;
+ struct usb_udc *udc;
/* readonly to gadget driver */
const struct usb_gadget_ops *ops;
struct usb_ep *ep0;