diff --git a/subsys/shell/modules/devmem_service.c b/subsys/shell/modules/devmem_service.c index 8b649e8093b..e1ebaee7ef3 100644 --- a/subsys/shell/modules/devmem_service.c +++ b/subsys/shell/modules/devmem_service.c @@ -315,10 +315,6 @@ static int cmd_devmem(const struct shell *sh, size_t argc, char **argv) uint32_t value = 0; uint8_t width; - if (argc < 2 || argc > 4) { - return -EINVAL; - } - phys_addr = strtoul(argv[1], NULL, 16); #if defined(CONFIG_MMU) || defined(CONFIG_PCIE) @@ -365,11 +361,11 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_devmem, cmd_load, 2, 1), SHELL_SUBCMD_SET_END); -SHELL_CMD_REGISTER(devmem, &sub_devmem, +SHELL_CMD_ARG_REGISTER(devmem, &sub_devmem, "Read/write physical memory\n" "Usage:\n" "Read memory at address with optional width:\n" - "devmem address [width]\n" + "devmem
[