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

Troy Kisky
2013-07-16T20:47:42Z

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 --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++) {
--
1.8.1.2