sandbox: Convert sb command to use new macro
Ise the new U_BOOT_CMD_WITH_SUBCMDS() macro instead of writing the code out manually. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
31
cmd/sb.c
31
cmd/sb.c
@@ -40,29 +40,10 @@ static int do_sb_state(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct cmd_tbl cmd_sb_sub[] = {
|
U_BOOT_LONGHELP(sb,
|
||||||
U_BOOT_CMD_MKENT(handoff, 1, 0, do_sb_handoff, "", ""),
|
|
||||||
U_BOOT_CMD_MKENT(state, 1, 0, do_sb_state, "", ""),
|
|
||||||
};
|
|
||||||
|
|
||||||
static int do_sb(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
|
||||||
{
|
|
||||||
struct cmd_tbl *c;
|
|
||||||
|
|
||||||
/* Skip past 'sb' */
|
|
||||||
argc--;
|
|
||||||
argv++;
|
|
||||||
|
|
||||||
c = find_cmd_tbl(argv[0], cmd_sb_sub, ARRAY_SIZE(cmd_sb_sub));
|
|
||||||
if (c)
|
|
||||||
return c->cmd(cmdtp, flag, argc, argv);
|
|
||||||
else
|
|
||||||
return CMD_RET_USAGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
U_BOOT_CMD(
|
|
||||||
sb, 8, 1, do_sb,
|
|
||||||
"Sandbox status commands",
|
|
||||||
"handoff - Show handoff data received from SPL\n"
|
"handoff - Show handoff data received from SPL\n"
|
||||||
"sb state - Show sandbox state"
|
"sb state - Show sandbox state");
|
||||||
);
|
|
||||||
|
U_BOOT_CMD_WITH_SUBCMDS(sb, "Sandbox status commands", sb_help_text,
|
||||||
|
U_BOOT_SUBCMD_MKENT(handoff, 1, 1, do_sb_handoff),
|
||||||
|
U_BOOT_SUBCMD_MKENT(state, 1, 1, do_sb_state));
|
||||||
|
Reference in New Issue
Block a user