@@ -107,9 +107,11 @@ static struct usb_ep_ops mv_ep_ops = {
static struct mv_ep ep[2 * NUM_ENDPOINTS];
static struct mv_drv controller = {
+ .udc = (struct mv_udc *)CONFIG_USB_REG_BASE,
.gadget = {
.ep0 = &ep[0].ep,
.name = "mv_udc",
+ .ops = &mv_udc_ops,
},
};
@@ -438,8 +440,6 @@ static int mvudc_probe(void)
struct ept_queue_head *head;
int i;
- controller.gadget.ops = &mv_udc_ops;
- controller.udc = (struct mv_udc *)CONFIG_USB_REG_BASE;
epts = memalign(PAGE_SIZE, QH_MAXNUM * sizeof(struct ept_queue_head));
memset(epts, 0, QH_MAXNUM * sizeof(struct ept_queue_head));
for (i = 0; i < 2 * NUM_ENDPOINTS; i++) {
Move the initialization of gadget.ops and udc from code to the static structure. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> --- drivers/usb/gadget/mv_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)