Patchwork [U-Boot,09/17] usb: mv_udc: Init mv_drv.gadget.ops statically

login
register
mail settings
Submitter Marek Vasut
Date July 10, 2013, 1:16 a.m.
Message ID <1373419003-10919-10-git-send-email-marex@denx.de>
Download mbox | patch
Permalink /patch/257947/
State Awaiting Upstream
Delegated to: Marek Vasut
Headers show

Comments

Marek Vasut - July 10, 2013, 1:16 a.m.
There is no need to init this field at runtime, so init it statically.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Lei Wen <leiwen@marvell.com>
Cc: Otavio Salvador <otavio@ossystems.com.br>
Cc: Stefano Babic <sbabic@denx.de>
---
 drivers/usb/gadget/mv_udc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
index 04e46e1..8fa9781 100644
--- a/drivers/usb/gadget/mv_udc.c
+++ b/drivers/usb/gadget/mv_udc.c
@@ -114,8 +114,9 @@  static const struct usb_ep mv_ep_init[2] = {
 };
 
 static struct mv_drv controller = {
-	.gadget = {
-		.name = "mv_udc",
+	.gadget	= {
+		.name	= "mv_udc",
+		.ops	= &mv_udc_ops,
 	},
 };
 
@@ -443,7 +444,6 @@  static int mvudc_probe(void)
 	int i;
 	const int num = 2 * NUM_ENDPOINTS;
 
-	controller.gadget.ops = &mv_udc_ops;
 	epts = memalign(PAGE_SIZE, num * sizeof(struct ept_queue_head));
 	memset(epts, 0, num * sizeof(struct ept_queue_head));
 	for (i = 0; i < 2 * NUM_ENDPOINTS; i++) {