[U-Boot] [PATCH] cmd_nand.c: converted to new style subcmd handling

Scott Wood scottwood at freescale.com
Mon Apr 19 22:36:37 CEST 2010


On Sun, Apr 04, 2010 at 09:53:16PM +0200, Frans Meulenbroeks wrote:
> converted to new style subcmd handling.
> partly tested on sheevaplug
> read and information commands tested on sheevaplug
> (sorry did not want to nuke my device so I did not want to
> test things like nand scrub)
> 
> Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks at gmail.com>

Sorry for the delay...

> +static int do_nand_read(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
> +{

The read and write functions are quite similar, and were not duplicated
previously.  Use one function, distinguishing with argv[0] (i.e. use subcmd
only where it makes sense).

Likewise for erase and scrub.

> +	if (argc < 4)
> +	{
> +		cmd_usage(cmdtp);
> +		return 1;
>  	}

The opening brace should be on the same line as the "if".

-Scott


More information about the U-Boot mailing list