From: Scott Wood Date: Mon, 19 Apr 2010 15:36:37 -0500 Subject: [U-Boot] [PATCH] cmd_nand.c: converted to new style subcmd handling In-Reply-To: <1270410796-23203-1-git-send-email-fransmeulenbroeks@gmail.com> References: <1270410796-23203-1-git-send-email-fransmeulenbroeks@gmail.com> Message-ID: <20100419203637.GA11453@schlenkerla.am.freescale.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 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