summaryrefslogtreecommitdiff
path: root/common/dfu.c
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2018-11-29 10:52:41 +0100
committerMarek Vasut <marex@denx.de>2018-12-07 16:31:45 +0100
commita06955ae1ef2a942f18025d4fefceea2c638a76f (patch)
tree2796cd005202d59118724ce82b10f348b52e9654 /common/dfu.c
parent57dbc151437b36cc1105857d222df28b095236d7 (diff)
usb: gadget: Do not call board_usb_xxx() directly in USB gadget drivers
Add 2 functions to wrap the calls to board_usb_init() and board_usb_cleanup(). This is a preparatory work for DM support for UDC drivers (DM_USB_GADGET). Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'common/dfu.c')
-rw-r--r--common/dfu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/dfu.c b/common/dfu.c
index 2620d3238b..44d1484d3d 100644
--- a/common/dfu.c
+++ b/common/dfu.c
@@ -23,9 +23,9 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
bool dfu_reset = false;
int ret, i = 0;
- ret = board_usb_init(usbctrl_index, USB_INIT_DEVICE);
+ ret = usb_gadget_initialize(usbctrl_index);
if (ret) {
- pr_err("board usb init failed\n");
+ pr_err("usb_gadget_initialize failed\n");
return CMD_RET_FAILURE;
}
g_dnl_clear_detach();
@@ -84,7 +84,7 @@ int run_usb_dnl_gadget(int usbctrl_index, char *usb_dnl_gadget)
}
exit:
g_dnl_unregister();
- board_usb_cleanup(usbctrl_index, USB_INIT_DEVICE);
+ usb_gadget_release(usbctrl_index);
if (dfu_reset)
do_reset(NULL, 0, 0, NULL);