diff options
| author | Peter Chen <peter.chen@freescale.com> | 2015-03-05 21:36:02 -0500 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2015-03-19 12:25:46 -0400 |
| commit | dfea9c94837d27e38c8cc85a3c1c7c268973c3c2 (patch) | |
| tree | b4f76788c83c4a0a8ae8e01e349e02055eb01bf9 /include/linux/usb | |
| parent | 7252f1bfd4bc97ec4b5fa7adaf3a1a45c325635c (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.h | 3 |
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 { | |||
| 474 | 474 | ||
| 475 | struct usb_gadget; | 475 | struct usb_gadget; |
| 476 | struct usb_gadget_driver; | 476 | struct usb_gadget_driver; |
| 477 | struct usb_udc; | ||
| 477 | 478 | ||
| 478 | /* the rest of the api to the controller hardware: device operations, | 479 | /* the rest of the api to the controller hardware: device operations, |
| 479 | * which don't involve endpoints (or i/o). | 480 | * which don't involve endpoints (or i/o). |
| @@ -496,6 +497,7 @@ struct usb_gadget_ops { | |||
| 496 | /** | 497 | /** |
| 497 | * struct usb_gadget - represents a usb slave device | 498 | * struct usb_gadget - represents a usb slave device |
| 498 | * @work: (internal use) Workqueue to be used for sysfs_notify() | 499 | * @work: (internal use) Workqueue to be used for sysfs_notify() |
| 500 | * @udc: struct usb_udc pointer for this gadget | ||
| 499 | * @ops: Function pointers used to access hardware-specific operations. | 501 | * @ops: Function pointers used to access hardware-specific operations. |
| 500 | * @ep0: Endpoint zero, used when reading or writing responses to | 502 | * @ep0: Endpoint zero, used when reading or writing responses to |
| 501 | * driver setup() requests | 503 | * driver setup() requests |
| @@ -545,6 +547,7 @@ struct usb_gadget_ops { | |||
| 545 | */ | 547 | */ |
| 546 | struct usb_gadget { | 548 | struct usb_gadget { |
| 547 | struct work_struct work; | 549 | struct work_struct work; |
| 550 | struct usb_udc *udc; | ||
| 548 | /* readonly to gadget driver */ | 551 | /* readonly to gadget driver */ |
| 549 | const struct usb_gadget_ops *ops; | 552 | const struct usb_gadget_ops *ops; |
| 550 | struct usb_ep *ep0; | 553 | struct usb_ep *ep0; |
