From 8632b36b96d38a85f2e71603a6f90ec9e4e5e37e Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 18 Nov 2023 14:05:20 -0700 Subject: command: Introduce functions to obtain command arguments Add some functions which provide an argument to a command, or NULL if the argument does not exist. Use the same numbering as argv[] since it seems less confusing than the previous idea. Signed-off-by: Simon Glass Suggested-by: Tom Rini --- cmd/fuse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/fuse.c') diff --git a/cmd/fuse.c b/cmd/fuse.c index 0676bb7a81..f884c894fb 100644 --- a/cmd/fuse.c +++ b/cmd/fuse.c @@ -44,7 +44,7 @@ static int confirm_prog(void) static int do_fuse(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { - const char *op = argc >= 2 ? argv[1] : NULL; + const char *op = cmd_arg1(argc, argv); int confirmed = argc >= 3 && !strcmp(argv[2], "-y"); u32 bank, word, cnt, val, cmp; ulong addr; -- cgit v1.2.3