]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_sd.c
Remove xmalloc.c, fix potential 0-pointer derefenrence in cli.c.
[z180-stamp.git] / avr / cmd_sd.c
index 9d6e5cadbf7b29fd1f63a567918e754fb7e6a511..366bdfc6ec9d0edbbe4386b815cc916be2dc5171 100644 (file)
@@ -4,10 +4,8 @@
  * SPDX-License-Identifier:    GPL-2.0
  */
 
-#include "common.h"
-//#include <stdlib.h>
+#include "cmd_sd.h"
 
-#include "command.h"
 #include "diskio.h"
 #include "ff.h"
 #include "eval_arg.h"
@@ -316,10 +314,7 @@ command_ret_t do_ioctl_sync(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char
 }
 
 
-static
-command_ret_t do_help(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[]);
-
-cmd_tbl_t cmd_sd_sub[] = {
+cmd_tbl_t cmd_tbl_sd[] = {
 CMD_TBL_ITEM(
        status, 2,                      CTBL_REPEAT,    do_status,
        "Socket staus",
@@ -371,34 +366,18 @@ CMD_TBL_ITEM(
 #ifdef  CONFIG_SYS_LONGHELP
        FSTR(""),
 #endif /* CONFIG_SYS_LONGHELP */
+       NULL,
 #ifdef CONFIG_AUTO_COMPLETE
-       0,
+       NULL,
 #endif
 },
+/* Mark end of table */
+CMD_TBL_END(cmd_tbl_sd)
 };
 
-static
-command_ret_t do_help(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
-{
-       return _do_help(cmd_sd_sub, ARRAY_SIZE(cmd_sd_sub), cmdtp, flag, argc, argv);
-}
-
 
 command_ret_t do_sd(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
 {
-       cmd_tbl_t *cp;
-
-       if (argc < 2)
-               return CMD_RET_USAGE;
-
-       /* drop initial "sd" arg */
-       argc--;
-       argv++;
-
-       cp = find_cmd_tbl(argv[0], cmd_sd_sub, ARRAY_SIZE(cmd_sd_sub));
-
-       if (cp)
-               return cp->cmd(cmdtp, flag, argc, argv);
-
+       puts_P("Huch?");
        return CMD_RET_USAGE;
 }