From 921f63e5723880bbbaf65429564e5638b7bbd002 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 29 Nov 2023 10:31:19 -0700 Subject: bootflow: Allow setting a cmdline arg with no value This is supposed to be supported by the 'bootflow cmd' command, at least according to the help. There is a 'bootflow cmd clear' but it is often more intuitive to use 'bootcmd cmd set' with an empty value. Update the command to pass BOOTFLOWCL_EMPTY in this case. Signed-off-by: Simon Glass --- cmd/bootflow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/bootflow.c') diff --git a/cmd/bootflow.c b/cmd/bootflow.c index 4a47265ebd5..cc6dfae1668 100644 --- a/cmd/bootflow.c +++ b/cmd/bootflow.c @@ -543,9 +543,9 @@ static int do_bootflow_cmdline(struct cmd_tbl *cmdtp, int flag, int argc, op = argv[1]; arg = argv[2]; if (*op == 's') { - if (argc < 4) + if (argc < 3) return CMD_RET_USAGE; - val = argv[3]; + val = argv[3] ?: (const char *)BOOTFLOWCL_EMPTY; } switch (*op) { -- cgit v1.2.3