summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/thordown.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/cmd/thordown.c b/cmd/thordown.c
index ae20dddfdd..838764ccef 100644
--- a/cmd/thordown.c
+++ b/cmd/thordown.c
@@ -52,13 +52,18 @@ int do_thor_down(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
goto exit;
}
- ret = thor_handle();
- if (ret) {
- pr_err("THOR failed: %d\n", ret);
- ret = CMD_RET_FAILURE;
- goto exit;
- }
-
+ do {
+ ret = thor_handle();
+ if (ret == THOR_DFU_REINIT_NEEDED) {
+ dfu_free_entities();
+ ret = dfu_init_env_entities(interface, devstring);
+ }
+ if (ret) {
+ pr_err("THOR failed: %d\n", ret);
+ ret = CMD_RET_FAILURE;
+ goto exit;
+ }
+ } while (ret == 0);
exit:
g_dnl_unregister();
usb_gadget_release(controller_index);