summaryrefslogtreecommitdiff
path: root/cmd/ubifs.c
diff options
context:
space:
mode:
authorTien Fong Chee <tien.fong.chee@intel.com>2018-07-06 16:26:01 +0800
committerTom Rini <trini@konsulko.com>2018-09-28 20:22:32 -0400
commit14dfc6482a9057472ea202d2df4133a45bc3c1bc (patch)
tree34b56c6fccaed666df1bf0fa5a245da6c40078a2 /cmd/ubifs.c
parent10c2044062d045e27cbcda739501b96f670fb7f1 (diff)
downloadu-boot-14dfc6482a9057472ea202d2df4133a45bc3c1bc.tar.gz
u-boot-14dfc6482a9057472ea202d2df4133a45bc3c1bc.tar.bz2
u-boot-14dfc6482a9057472ea202d2df4133a45bc3c1bc.zip
cmd: ubifs: Factor out some checking codes into cmd_ubifs_mount()
cmd_ubifs_mount() function would be called directly instead of involving whole command machinery for mounting ubifs in generic firmware loader, so some checking codes need to be factored out into cmd_ubifs_mount() without breaking original functionality design. Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'cmd/ubifs.c')
-rw-r--r--cmd/ubifs.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/cmd/ubifs.c b/cmd/ubifs.c
index 171034801b..e4000b7ad1 100644
--- a/cmd/ubifs.c
+++ b/cmd/ubifs.c
@@ -19,16 +19,10 @@
static int ubifs_initialized;
static int ubifs_mounted;
-static int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc,
- char * const argv[])
+int cmd_ubifs_mount(char *vol_name)
{
- char *vol_name;
int ret;
- if (argc != 2)
- return CMD_RET_USAGE;
-
- vol_name = argv[1];
debug("Using volume %s\n", vol_name);
if (ubifs_initialized == 0) {
@@ -42,7 +36,19 @@ static int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc,
ubifs_mounted = 1;
- return 0;
+ return ret;
+}
+static int do_ubifs_mount(cmd_tbl_t *cmdtp, int flag, int argc,
+ char * const argv[])
+{
+ char *vol_name;
+
+ if (argc != 2)
+ return CMD_RET_USAGE;
+
+ vol_name = argv[1];
+
+ return cmd_ubifs_mount(vol_name);
}
int ubifs_is_mounted(void)