From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kishon Vijay Abraham I Date: Mon, 10 Aug 2015 16:45:49 +0530 Subject: [U-Boot] [PATCH 1/3] usb: gadget: ether: Perform board initialization from ethernet gadget driver In-Reply-To: <1439205351-14092-1-git-send-email-kishon@ti.com> References: <1439205351-14092-1-git-send-email-kishon@ti.com> Message-ID: <1439205351-14092-2-git-send-email-kishon@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Ethernet gadget driver can be used both by both SPL and u-boot. Since usb_eth_init() is the entry point for ethernet gadget driver, perform board initialization there. Also perform the cleanup in usb_eth_halt. Signed-off-by: Kishon Vijay Abraham I Acked-by: Marek Vasut --- drivers/usb/gadget/ether.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 141ff8b..850ba02 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -2312,6 +2313,8 @@ static int usb_eth_init(struct eth_device *netdev, bd_t *bd) goto fail; } + board_usb_init(0, USB_INIT_DEVICE); + /* Configure default mac-addresses for the USB ethernet device */ #ifdef CONFIG_USBNET_DEV_ADDR strlcpy(dev_addr, CONFIG_USBNET_DEV_ADDR, sizeof(dev_addr)); @@ -2492,6 +2495,7 @@ void usb_eth_halt(struct eth_device *netdev) } usb_gadget_unregister_driver(ð_driver); + board_usb_cleanup(0, USB_INIT_DEVICE); } static struct usb_gadget_driver eth_driver = { -- 1.7.9.5