diff mbox

[U-Boot,RFC,V1,14/18] usb: gadget: mv_udc: use static initialization of ops, udc

Message ID 1374007666-2749-15-git-send-email-troy.kisky@boundarydevices.com
State Changes Requested
Delegated to: Marek Vasut
Headers show

Commit Message

Troy Kisky July 16, 2013, 8:47 p.m. UTC
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(-)
diff mbox

Patch

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index 820a3b8..8f3d975 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -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++) {