aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorEugeniu Rosca <erosca@de.adit-jv.com>2020-10-23 11:52:21 +0300
committerMarek Vasut <marex@denx.de>2021-01-31 14:08:56 +0100
commite2ffb3be4986e9ecbfb6ec22e8458ef16873912d (patch)
tree77ab053f11dd00068ba7d1ac634d4b0ff73e2751 /cmd
parent02ebe6deae994c377dedafa7df4abd70fd2e3f44 (diff)
downloadu-boot-e2ffb3be4986e9ecbfb6ec22e8458ef16873912d.zip
u-boot-e2ffb3be4986e9ecbfb6ec22e8458ef16873912d.tar.gz
u-boot-e2ffb3be4986e9ecbfb6ec22e8458ef16873912d.tar.bz2
cmd: bcb: Extract '__bcb_store' from 'do_bcb_store' for internal needs
Enriching the functionality of U-Boot 'bcb' may assume using the existing sub-commands as building blocks for the next ones. A clean way to achive the above is to expose a number of static routines, each mapped to an existing user command (e.g. load/set/store), with a user/caller-friendly prototype (i.e. do not force the caller to wrap an integer into a string). This third patch makes '__bcb_store' available for internal needs. No functional change intended. Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com> Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bcb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/cmd/bcb.c b/cmd/bcb.c
index 113f04f..b9cd20e 100644
--- a/cmd/bcb.c
+++ b/cmd/bcb.c
@@ -270,8 +270,7 @@ static int do_bcb_dump(struct cmd_tbl *cmdtp, int flag, int argc,
return CMD_RET_SUCCESS;
}
-static int do_bcb_store(struct cmd_tbl *cmdtp, int flag, int argc,
- char *const argv[])
+static int __bcb_store(void)
{
struct blk_desc *desc;
struct disk_partition info;
@@ -302,6 +301,12 @@ err:
return CMD_RET_FAILURE;
}
+static int do_bcb_store(struct cmd_tbl *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ return __bcb_store();
+}
+
static struct cmd_tbl cmd_bcb_sub[] = {
U_BOOT_CMD_MKENT(load, CONFIG_SYS_MAXARGS, 1, do_bcb_load, "", ""),
U_BOOT_CMD_MKENT(set, CONFIG_SYS_MAXARGS, 1, do_bcb_set, "", ""),