From patchwork Thu Aug 6 16:15:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 504740 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 036541402B5 for ; Fri, 7 Aug 2015 02:16:41 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B36BFB37D6; Thu, 6 Aug 2015 18:16:37 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YZ2aySlgr6lV; Thu, 6 Aug 2015 18:16:37 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 810E7B37D7; Thu, 6 Aug 2015 18:16:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6E678A747F for ; Thu, 6 Aug 2015 18:16:26 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UM69YxmGlxPf for ; Thu, 6 Aug 2015 18:16:26 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 040E8A7463 for ; Thu, 6 Aug 2015 18:16:23 +0200 (CEST) Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t76GGK8U017476; Thu, 6 Aug 2015 11:16:20 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id t76GGKHu029959; Thu, 6 Aug 2015 11:16:20 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.224.2; Thu, 6 Aug 2015 11:16:19 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id t76GGCbP019981; Thu, 6 Aug 2015 11:16:17 -0500 From: Kishon Vijay Abraham I To: , , , , Date: Thu, 6 Aug 2015 21:45:52 +0530 Message-ID: <1438877771-23513-3-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1438877771-23513-1-git-send-email-kishon@ti.com> References: <1438877771-23513-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Cc: kishon@ti.com Subject: [U-Boot] [PATCH 02/21] usb: gadget: ether: Perform board initialization from ethernet gadget driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 = {