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/mmc.c | |
parent | 691d719db7183dfb1d1360efed4c5e9f6899095f (diff) |
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/mmc.c')
-rw-r--r-- | cmd/mmc.c | 111 |
1 files changed, 62 insertions, 49 deletions
@@ -142,7 +142,9 @@ static struct mmc *init_mmc_device(int dev, bool force_init) return mmc; } -static int do_mmcinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) + +static int do_mmcinfo(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { struct mmc *mmc; @@ -175,8 +177,9 @@ static int confirm_key_prog(void) puts("Authentication key programming aborted\n"); return 0; } -static int do_mmcrpmb_key(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmcrpmb_key(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { void *key_addr; struct mmc *mmc = find_mmc_device(curr_device); @@ -193,8 +196,9 @@ static int do_mmcrpmb_key(cmd_tbl_t *cmdtp, int flag, } return CMD_RET_SUCCESS; } -static int do_mmcrpmb_read(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmcrpmb_read(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { u16 blk, cnt; void *addr; @@ -221,8 +225,9 @@ static int do_mmcrpmb_read(cmd_tbl_t *cmdtp, int flag, return CMD_RET_FAILURE; return CMD_RET_SUCCESS; } -static int do_mmcrpmb_write(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmcrpmb_write(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { u16 blk, cnt; void *addr; @@ -247,8 +252,9 @@ static int do_mmcrpmb_write(cmd_tbl_t *cmdtp, int flag, return CMD_RET_FAILURE; return CMD_RET_SUCCESS; } -static int do_mmcrpmb_counter(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmcrpmb_counter(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { unsigned long counter; struct mmc *mmc = find_mmc_device(curr_device); @@ -259,17 +265,17 @@ static int do_mmcrpmb_counter(cmd_tbl_t *cmdtp, int flag, return CMD_RET_SUCCESS; } -static cmd_tbl_t cmd_rpmb[] = { +static struct cmd_tbl cmd_rpmb[] = { U_BOOT_CMD_MKENT(key, 2, 0, do_mmcrpmb_key, "", ""), U_BOOT_CMD_MKENT(read, 5, 1, do_mmcrpmb_read, "", ""), U_BOOT_CMD_MKENT(write, 5, 0, do_mmcrpmb_write, "", ""), U_BOOT_CMD_MKENT(counter, 1, 1, do_mmcrpmb_counter, "", ""), }; -static int do_mmcrpmb(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmcrpmb(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { - cmd_tbl_t *cp; + struct cmd_tbl *cp; struct mmc *mmc; char original_part; int ret; @@ -316,8 +322,8 @@ static int do_mmcrpmb(cmd_tbl_t *cmdtp, int flag, } #endif -static int do_mmc_read(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_read(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { struct mmc *mmc; u32 blk, cnt, n; @@ -358,8 +364,8 @@ static lbaint_t mmc_sparse_reserve(struct sparse_storage *info, return blkcnt; } -static int do_mmc_sparse_write(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_sparse_write(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { struct sparse_storage sparse; struct blk_desc *dev_desc; @@ -409,8 +415,8 @@ static int do_mmc_sparse_write(cmd_tbl_t *cmdtp, int flag, #endif #if CONFIG_IS_ENABLED(MMC_WRITE) -static int do_mmc_write(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_write(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { struct mmc *mmc; u32 blk, cnt, n; @@ -439,8 +445,9 @@ static int do_mmc_write(cmd_tbl_t *cmdtp, int flag, return (n == cnt) ? CMD_RET_SUCCESS : CMD_RET_FAILURE; } -static int do_mmc_erase(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmc_erase(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { struct mmc *mmc; u32 blk, cnt, n; @@ -469,8 +476,8 @@ static int do_mmc_erase(cmd_tbl_t *cmdtp, int flag, } #endif -static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_rescan(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { struct mmc *mmc; @@ -480,8 +487,9 @@ static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag, return CMD_RET_SUCCESS; } -static int do_mmc_part(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmc_part(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { struct blk_desc *mmc_dev; struct mmc *mmc; @@ -499,8 +507,9 @@ static int do_mmc_part(cmd_tbl_t *cmdtp, int flag, puts("get mmc type error!\n"); return CMD_RET_FAILURE; } -static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { int dev, part = 0, ret; struct mmc *mmc; @@ -540,8 +549,9 @@ static int do_mmc_dev(cmd_tbl_t *cmdtp, int flag, return CMD_RET_SUCCESS; } -static int do_mmc_list(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmc_list(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { print_mmc_devices('\n'); return CMD_RET_SUCCESS; @@ -549,7 +559,7 @@ static int do_mmc_list(cmd_tbl_t *cmdtp, int flag, #if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING) static int parse_hwpart_user(struct mmc_hwpart_conf *pconf, - int argc, char * const argv[]) + int argc, char *const argv[]) { int i = 0; @@ -583,7 +593,7 @@ static int parse_hwpart_user(struct mmc_hwpart_conf *pconf, } static int parse_hwpart_gp(struct mmc_hwpart_conf *pconf, int pidx, - int argc, char * const argv[]) + int argc, char *const argv[]) { int i; @@ -616,8 +626,8 @@ static int parse_hwpart_gp(struct mmc_hwpart_conf *pconf, int pidx, return i; } -static int do_mmc_hwpartition(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_hwpartition(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { struct mmc *mmc; struct mmc_hwpart_conf pconf = { }; @@ -700,8 +710,8 @@ static int do_mmc_hwpartition(cmd_tbl_t *cmdtp, int flag, #endif #ifdef CONFIG_SUPPORT_EMMC_BOOT -static int do_mmc_bootbus(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_bootbus(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { int dev; struct mmc *mmc; @@ -726,8 +736,9 @@ static int do_mmc_bootbus(cmd_tbl_t *cmdtp, int flag, /* acknowledge to be sent during boot operation */ return mmc_set_boot_bus_width(mmc, width, reset, mode); } -static int do_mmc_boot_resize(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmc_boot_resize(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { int dev; struct mmc *mmc; @@ -779,8 +790,8 @@ static int mmc_partconf_print(struct mmc *mmc) return CMD_RET_SUCCESS; } -static int do_mmc_partconf(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_partconf(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { int dev; struct mmc *mmc; @@ -810,8 +821,9 @@ static int do_mmc_partconf(cmd_tbl_t *cmdtp, int flag, /* acknowledge to be sent during boot operation */ return mmc_set_part_conf(mmc, ack, part_num, access); } -static int do_mmc_rst_func(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) + +static int do_mmc_rst_func(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { int dev; struct mmc *mmc; @@ -845,8 +857,8 @@ static int do_mmc_rst_func(cmd_tbl_t *cmdtp, int flag, return mmc_set_rst_n_function(mmc, enable); } #endif -static int do_mmc_setdsr(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_setdsr(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { struct mmc *mmc; u32 val; @@ -874,8 +886,8 @@ static int do_mmc_setdsr(cmd_tbl_t *cmdtp, int flag, } #ifdef CONFIG_CMD_BKOPS_ENABLE -static int do_mmc_bkops_enable(cmd_tbl_t *cmdtp, int flag, - int argc, char * const argv[]) +static int do_mmc_bkops_enable(struct cmd_tbl *cmdtp, int flag, + int argc, char *const argv[]) { int dev; struct mmc *mmc; @@ -898,7 +910,7 @@ static int do_mmc_bkops_enable(cmd_tbl_t *cmdtp, int flag, } #endif -static int do_mmc_boot_wp(cmd_tbl_t *cmdtp, int flag, +static int do_mmc_boot_wp(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) { int err; @@ -918,7 +930,7 @@ static int do_mmc_boot_wp(cmd_tbl_t *cmdtp, int flag, return CMD_RET_SUCCESS; } -static cmd_tbl_t cmd_mmc[] = { +static struct cmd_tbl cmd_mmc[] = { U_BOOT_CMD_MKENT(info, 1, 0, do_mmcinfo, "", ""), U_BOOT_CMD_MKENT(read, 4, 1, do_mmc_read, "", ""), U_BOOT_CMD_MKENT(wp, 1, 0, do_mmc_boot_wp, "", ""), @@ -951,9 +963,10 @@ static cmd_tbl_t cmd_mmc[] = { #endif }; -static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) +static int do_mmcops(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) { - cmd_tbl_t *cp; + struct cmd_tbl *cp; cp = find_cmd_tbl(argv[1], cmd_mmc, ARRAY_SIZE(cmd_mmc)); |