From: Kishon Vijay Abraham I Date: Mon, 23 Feb 2015 18:40:18 +0530 Subject: [U-Boot] [u-boot PATCH v2 35/40] common: cmd_dfu: invoke board_usb_cleanup() for cleaning up In-Reply-To: <1424697023-26696-1-git-send-email-kishon@ti.com> References: <1424697023-26696-1-git-send-email-kishon@ti.com> Message-ID: <1424697023-26696-36-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 Invoked board_usb_cleanup for cleaning up initialized USB. It will be invoked if the user enterts ctrl-C. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Lukasz Majewski --- common/cmd_dfu.c | 1 + common/usb.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c index e975abe..161d38b 100644 --- a/common/cmd_dfu.c +++ b/common/cmd_dfu.c @@ -68,6 +68,7 @@ static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) } exit: g_dnl_unregister(); + board_usb_cleanup(controller_index, USB_INIT_DEVICE); done: dfu_free_entities(); diff --git a/common/usb.c b/common/usb.c index 736cd9f..fbb4495 100644 --- a/common/usb.c +++ b/common/usb.c @@ -1063,4 +1063,10 @@ int board_usb_init(int index, enum usb_init_type init) { return 0; } + +__weak +int board_usb_cleanup(int index, enum usb_init_type init) +{ + return 0; +} /* EOF */ -- 1.7.9.5