usb: gadget: move global vars from epautoconf into struct usb_gadget

epautoconf has two global variables which count the endpoint number of
last assigned endpoint.
This patch removes the global variable and keeps it as per (UDC) gadget.
While here, the ifdef is removed and now the in and outpoint are
enumerated unconditionally. The dwc3 for instance supports 32 endpoints
in total.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
Sebastian Andrzej Siewior 2012-09-06 20:11:11 +02:00 committed by Felipe Balbi
parent 0ba16dea72
commit e87bb7118c
2 changed files with 10 additions and 21 deletions

View file

@ -503,6 +503,8 @@ struct usb_gadget_ops {
* @name: Identifies the controller hardware type. Used in diagnostics
* and sometimes configuration.
* @dev: Driver model state for this abstract device.
* @out_epnum: last used out ep number
* @in_epnum: last used in ep number
*
* Gadgets have a mostly-portable "gadget driver" implementing device
* functions, handling all usb configurations and interfaces. Gadget
@ -537,6 +539,8 @@ struct usb_gadget {
unsigned a_alt_hnp_support:1;
const char *name;
struct device dev;
unsigned out_epnum;
unsigned in_epnum;
};
static inline void set_gadget_data(struct usb_gadget *gadget, void *data)