public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chee, Tien Fong <tien.fong.chee@intel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v7 2/3] cmd: ubifs: Move ubifs_initialized checking into cmd_ubifs_umount()
Date: Thu, 1 Feb 2018 06:10:46 +0000	[thread overview]
Message-ID: <1517465446.2520.0.camel@intel.com> (raw)
In-Reply-To: <11ab76b9-d260-f1be-0b61-84cfbf465aa2@denx.de>

On Tue, 2018-01-30 at 13:09 +0100, Marek Vasut wrote:
> On 01/30/2018 12:16 PM, tien.fong.chee at intel.com wrote:
> > 
> > From: Tien Fong Chee <tien.fong.chee@intel.com>
> > 
> > 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.
> > 
> > Signed-off-by: Tien Fong Chee <tien.fong.chee@intel.com>64db5518baa
> > 2ea1a8a0e81cc485d760b850c7052
> > ---
> >  cmd/ubifs.c         | 20 ++++++++++++--------
> >  include/ubi_uboot.h |  1 +
> >  2 files changed, 13 insertions(+), 8 deletions(-)
> > 
> > diff --git a/cmd/ubifs.c b/cmd/ubifs.c
> > index 5e9d357..d18e0da 100644
> > --- a/cmd/ubifs.c
> > +++ b/cmd/ubifs.c
> > @@ -51,27 +51,31 @@ 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,
> >  				char * const argv[])
> >  {
> > +	int ret;
> > +
> >  	if (argc != 1)
> >  		return CMD_RET_USAGE;
> >  
> > -	if (ubifs_initialized == 0) {
> > -		printf("No UBIFS volume mounted!\n");
> > -		return -1;
> > -	}
> > -
> > -	cmd_ubifs_umount();
> > +	ret = cmd_ubifs_umount();
> return cmd_ubifs_umount() directly ?
> 
Okay.
> > 
> > -	return 0;
> > +	return ret;
> >  }
> >  
> >  static int do_ubifs_ls(cmd_tbl_t *cmdtp, int flag, int argc,
> > diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h
> > index 80acbcb..827dbfc 100644
> > --- a/include/ubi_uboot.h
> > +++ b/include/ubi_uboot.h
> > @@ -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
> > 
> 

  reply	other threads:[~2018-02-01  6:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 11:16 [U-Boot] [PATCH v7 0/3] Generic firmware loader tien.fong.chee at intel.com
2018-01-30 11:16 ` [U-Boot] [PATCH v7 1/3] spl: Remove static declaration on spl_mmc_find_device function tien.fong.chee at intel.com
2018-01-30 11:16 ` [U-Boot] [PATCH v7 2/3] cmd: ubifs: Move ubifs_initialized checking into cmd_ubifs_umount() tien.fong.chee at intel.com
2018-01-30 12:09   ` Marek Vasut
2018-02-01  6:10     ` Chee, Tien Fong [this message]
2018-01-30 11:16 ` [U-Boot] [PATCH v7 3/3] common: Generic firmware loader for file system tien.fong.chee at intel.com
2018-01-30 12:12   ` Marek Vasut
2018-02-01  7:06     ` Chee, Tien Fong
2018-02-01  9:16       ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517465446.2520.0.camel@intel.com \
    --to=tien.fong.chee@intel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox