Skip to contentSkip to conversation

cmd: ubifs: Move ubifs_initialized checking into cmd_ubifs_umount()

PATCH New tien.fong.chee at intel.com 3 participants 3 messages Jul 6, 2018 – Sep 29, 2018

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/6 cmd: ubifs: Move ubifs_initialized checking into cmd_ubifs_umount()

From: Tien Fong Chee <[email protected]>

cmd_ubifs_umount() function would be called directly instead of involving whole command machinery in generic firmware loader, so checking on ubifs_initialized status need to be done in cmd_ubifs_umount() without breaking original functionality design.

---
 cmd/ubifs.c         | 18 +++++++++---------
 include/ubi_uboot.h |  1 +
 2 files changed, 10 insertions(+), 9 deletions(-)
cmd/ubifs.c +9 -9
index 11bab7a..1710348 100644
@@ -50,11 +50,18 @@ int ubifs_is_mounted(void)
 	return ubifs_mounted;
 }
 
-void cmd_ubifs_umount(void)
+int cmd_ubifs_umount(void)
 {
+	if (ubifs_initialized == 0) {
+		printf("No UBIFS volume mounted!\n");
+		return -1;
+	}
+
 	uboot_ubifs_umount();
 	ubifs_mounted = 0;
 	ubifs_initialized = 0;
+
+	return 0;
 }
 
 static int do_ubifs_umount(cmd_tbl_t *cmdtp, int flag, int argc,
@@ -63,14 +70,7 @@ static int do_ubifs_umount(cmd_tbl_t *cmdtp, int flag, int argc,
 	if (argc != 1)
 		return CMD_RET_USAGE;
 
-	if (ubifs_initialized == 0) {
-		printf("No UBIFS volume mounted!\n");
-		return -1;
-	}
-
-	cmd_ubifs_umount();
-
-	return 0;
+	return cmd_ubifs_umount();
 }
 
 static int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc,
include/ubi_uboot.h +1 -0
index 80acbcb..827dbfc 100644
@@ -75,5 +75,6 @@ extern int ubi_volume_write(char *volume, void *buf, size_t size);
 extern int ubi_volume_read(char *volume, char *buf, size_t size);
 
 extern struct ubi_device *ubi_devices[];
+int cmd_ubifs_umount(void);
 
 #endif
Signature · 1 line
2.2.0
#1 lore raw

PATCH v4 1/6 cmd: ubifs: Move ubifs_initialized checking into cmd_ubifs_umount()

Hello Tien.fong.chee

Am 06.07.2018 um 10:25 schrieb tien.fong.chee at intel.com:

Quoted 7 lines

From: Tien Fong Chee <[email protected]>

cmd_ubifs_umount() function would be called directly instead of involving whole command machinery in generic firmware loader, so checking on ubifs_initialized status need to be done in cmd_ubifs_umount() without breaking original functionality design.

Quoted 6 lines
---
  cmd/ubifs.c         | 18 +++++++++---------
  include/ubi_uboot.h |  1 +
  2 files changed, 10 insertions(+), 9 deletions(-)

bye,
Heiko

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de
#2 lore raw

PATCH v4 1/6 cmd: ubifs: Move ubifs_initialized checking into cmd_ubifs_umount()

In reply to tien.fong.chee at intel.com
Quoted 10 lines · tien.fong.chee at intel.com

From: Tien Fong Chee <[email protected]>

cmd_ubifs_umount() function would be called directly instead of involving whole command machinery in generic firmware loader, so checking on ubifs_initialized status need to be done in cmd_ubifs_umount() without breaking original functionality design.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180929/29fe2dce/attachment.sig>