aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/gsc.c
diff options
context:
space:
mode:
authorSimon Glass2023-11-18 14:05:20 -0700
committerTom Rini2023-12-13 11:51:24 -0500
commit8632b36b96d38a85f2e71603a6f90ec9e4e5e37e (patch)
tree90955cdb3d121e37567fe4226f9862566220af57 /drivers/misc/gsc.c
parent1047b5340c1203f825c0a68b33997b787be0123e (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 'drivers/misc/gsc.c')
-rw-r--r--drivers/misc/gsc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/gsc.c b/drivers/misc/gsc.c
index 65c9c2c6ce3..feb02f97065 100644
--- a/drivers/misc/gsc.c
+++ b/drivers/misc/gsc.c
@@ -531,10 +531,10 @@ static int do_gsc(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]
if (!gsc_wd_disable(dev))
return CMD_RET_SUCCESS;
} else if (strcasecmp(argv[1], "thermal") == 0) {
- char *cmd, *val;
+ const char *cmd, *val;
- cmd = (argc > 2) ? argv[2] : NULL;
- val = (argc > 3) ? argv[3] : NULL;
+ cmd = cmd_arg2(argc, argv);
+ val = cmd_arg3(argc, argv);
if (!gsc_thermal(dev, cmd, val))
return CMD_RET_SUCCESS;
}