Skip to content

Commit e9b0fd8

Browse files
Masami Hiramatsutrini
Masami Hiramatsu
authored andcommitted
cmd/dfu: Enable 'dfu list' command without DFU_OVER_USB
Since dfu is not only used for USB, and some platform only supports DFU_OVER_TFTP or EFI capsule update, dfu_alt_info is defined on such platforms too. For such platform, 'dfu list' command is useful to check how the current dfu_alt_info setting is parsed. Signed-off-by: Masami Hiramatsu <[email protected]>
1 parent c25a838 commit e9b0fd8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

cmd/dfu.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
2828
#ifdef CONFIG_DFU_OVER_USB
2929
char *usb_controller = argv[1];
3030
#endif
31-
#if defined(CONFIG_DFU_OVER_USB) || defined(CONFIG_DFU_OVER_TFTP)
3231
char *interface = NULL;
3332
char *devstring = NULL;
3433
#if defined(CONFIG_DFU_TIMEOUT) || defined(CONFIG_DFU_OVER_TFTP)
@@ -42,15 +41,13 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
4241
#if defined(CONFIG_DFU_TIMEOUT) || defined(CONFIG_DFU_OVER_TFTP)
4342
if (argc == 5 || argc == 3)
4443
value = simple_strtoul(argv[argc - 1], NULL, 0);
45-
#endif
4644
#endif
4745

4846
int ret = 0;
4947
#ifdef CONFIG_DFU_OVER_TFTP
5048
if (!strcmp(argv[1], "tftp"))
5149
return update_tftp(value, interface, devstring);
5250
#endif
53-
#ifdef CONFIG_DFU_OVER_USB
5451
ret = dfu_init_env_entities(interface, devstring);
5552
if (ret)
5653
goto done;
@@ -65,6 +62,7 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
6562
goto done;
6663
}
6764

65+
#ifdef CONFIG_DFU_OVER_USB
6866
int controller_index = simple_strtoul(usb_controller, NULL, 0);
6967
bool retry = false;
7068
do {
@@ -79,9 +77,9 @@ static int do_dfu(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
7977
}
8078
} while (retry);
8179

80+
#endif
8281
done:
8382
dfu_free_entities();
84-
#endif
8583
return ret;
8684
}
8785

@@ -100,8 +98,8 @@ U_BOOT_CMD(dfu, CONFIG_SYS_MAXARGS, 1, do_dfu,
10098
#ifdef CONFIG_DFU_TIMEOUT
10199
" [<timeout>] - specify inactivity timeout in seconds\n"
102100
#endif
103-
" [list] - list available alt settings\n"
104101
#endif
102+
" [list] - list available alt settings\n"
105103
#ifdef CONFIG_DFU_OVER_TFTP
106104
#ifdef CONFIG_DFU_OVER_USB
107105
"dfu "

0 commit comments

Comments
 (0)