summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/cmd_dfu.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/common/cmd_dfu.c b/common/cmd_dfu.c
index 793c4221236..d3658cf7ee9 100644
--- a/common/cmd_dfu.c
+++ b/common/cmd_dfu.c
@@ -17,26 +17,15 @@
static int do_dfu(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
- const char *str_env;
char *s = "dfu";
int ret, i = 0;
- char *env_bkp;
if (argc < 3)
return CMD_RET_USAGE;
- str_env = getenv("dfu_alt_info");
- if (str_env == NULL) {
- printf("%s: \"dfu_alt_info\" env variable not defined!\n",
- __func__);
- return CMD_RET_FAILURE;
- }
-
- env_bkp = strdup(str_env);
- ret = dfu_config_entities(env_bkp, argv[1],
- (int)simple_strtoul(argv[2], NULL, 10));
+ ret = dfu_init_env_entities(argv[1], simple_strtoul(argv[2], NULL, 10));
if (ret)
- return CMD_RET_FAILURE;
+ return ret;
if (argc > 3 && strcmp(argv[3], "list") == 0) {
dfu_show_entities();
@@ -67,7 +56,6 @@ exit:
g_dnl_unregister();
done:
dfu_free_entities();
- free(env_bkp);
if (dfu_reset())
run_command("reset", 0);