usb: mv_udc: Make use of struct ehci_ctrl

The usb_lowlevel_init() call already fills and passes back struct
ehci_ctrl , which readily contains correctly determined address of
the port register block address computed from values from controller
configuration registers. Leverage this and make use of this value
as this makes the code mode universal, but also gets us rid of the
CONFIG_USB_REG_BASE configuration option.

Moreover, this patch cleans up the usb_gadget_register_driver() call
a little by correcting the error handling. Note the usb_lowlevel_init()
and mvudc_probe() are now called in reversed order, but this has no
impact on the code.

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>
diff --git a/include/usb/mv_udc.h b/include/usb/mv_udc.h
index ffddb75..4b8ad7e 100644
--- a/include/usb/mv_udc.h
+++ b/include/usb/mv_udc.h
@@ -14,6 +14,8 @@
 #include <linux/usb/ch9.h>
 #include <linux/usb/gadget.h>
 
+#include "../../drivers/usb/host/ehci.h"
+
 #define NUM_ENDPOINTS		6
 
 /* Endpoint parameters */
@@ -23,7 +25,6 @@
 #define EP0_MAX_PACKET_SIZE	64
 
 struct mv_udc {
-	u32 pad0[80];
 #define MICRO_8FRAME	0x8
 #define USBCMD_ITC(x)	((((x) > 0xff) ? 0xff : x) << 16)
 #define USBCMD_FS2	(1 << 15)
@@ -73,7 +74,7 @@
 struct mv_drv {
 	struct usb_gadget		gadget;
 	struct usb_gadget_driver	*driver;
-	struct mv_udc			*udc;
+	struct ehci_ctrl		*ctrl;
 	struct mv_ep			ep[NUM_ENDPOINTS];
 };
 
@@ -121,5 +122,4 @@
 #define INFO_BUFFER_ERROR	(1 << 5)
 #define INFO_TX_ERROR		(1 << 3)
 
-extern int usb_lowlevel_init(int index, void **controller);
 #endif /* __MV_UDC_H__ */