diff options
author | Simon Glass <sjg@chromium.org> | 2023-11-18 14:05:20 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-12-13 11:51:24 -0500 |
commit | 8632b36b96d38a85f2e71603a6f90ec9e4e5e37e (patch) | |
tree | 90955cdb3d121e37567fe4226f9862566220af57 /cmd/disk.c | |
parent | 1047b5340c1203f825c0a68b33997b787be0123e (diff) |
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 <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'cmd/disk.c')
-rw-r--r-- | cmd/disk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/disk.c b/cmd/disk.c index 3d7bc2f6018..92eaa02f4a1 100644 --- a/cmd/disk.c +++ b/cmd/disk.c @@ -40,8 +40,8 @@ int common_diskboot(struct cmd_tbl *cmdtp, const char *intf, int argc, bootstage_mark(BOOTSTAGE_ID_IDE_BOOT_DEVICE); - part = blk_get_device_part_str(intf, (argc == 3) ? argv[2] : NULL, - &dev_desc, &info, 1); + part = blk_get_device_part_str(intf, cmd_arg2(argc, argv), + &dev_desc, &info, 1); if (part < 0) { bootstage_error(BOOTSTAGE_ID_IDE_TYPE); return 1; |