diff options
author | Simon Glass <sjg@chromium.org> | 2020-05-10 11:40:03 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-05-18 18:36:55 -0400 |
commit | 09140113108541b95d340f3c7b6ee597d31ccc73 (patch) | |
tree | 4b4241b799bbbb2eeef4164392442b193af1703f /cmd/demo.c | |
parent | 691d719db7183dfb1d1360efed4c5e9f6899095f (diff) | |
download | u-boot-09140113108541b95d340f3c7b6ee597d31ccc73.tar.gz |
command: Remove the cmd_tbl_t typedef
We should not use typedefs in U-Boot. They cannot be used as forward
declarations which means that header files must include the full header to
access them.
Drop the typedef and rename the struct to remove the _s suffix which is
now not useful.
This requires quite a few header-file additions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd/demo.c')
-rw-r--r-- | cmd/demo.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/cmd/demo.c b/cmd/demo.c index 52c6e7ec15..9da06f5e4d 100644 --- a/cmd/demo.c +++ b/cmd/demo.c @@ -7,14 +7,15 @@ */ #include <common.h> +#include <command.h> #include <dm-demo.h> #include <mapmem.h> #include <asm/io.h> struct udevice *demo_dev; -static int do_demo_hello(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int do_demo_hello(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { int ch = 0; @@ -24,8 +25,8 @@ static int do_demo_hello(cmd_tbl_t *cmdtp, int flag, int argc, return demo_hello(demo_dev, ch); } -static int do_demo_status(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int do_demo_status(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { int status; int ret; @@ -39,8 +40,8 @@ static int do_demo_status(cmd_tbl_t *cmdtp, int flag, int argc, return 0; } -static int do_demo_light(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) +static int do_demo_light(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { int light; int ret; @@ -59,7 +60,7 @@ static int do_demo_light(cmd_tbl_t *cmdtp, int flag, int argc, return ret; } -int do_demo_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +int do_demo_list(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct udevice *dev; int i, ret; @@ -78,16 +79,17 @@ int do_demo_list(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return cmd_process_error(cmdtp, ret); } -static cmd_tbl_t demo_commands[] = { +static struct cmd_tbl demo_commands[] = { U_BOOT_CMD_MKENT(list, 0, 1, do_demo_list, "", ""), U_BOOT_CMD_MKENT(hello, 2, 1, do_demo_hello, "", ""), U_BOOT_CMD_MKENT(light, 2, 1, do_demo_light, "", ""), U_BOOT_CMD_MKENT(status, 1, 1, do_demo_status, "", ""), }; -static int do_demo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_demo(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { - cmd_tbl_t *demo_cmd; + struct cmd_tbl *demo_cmd; int devnum = 0; int ret; |