[U-Boot] [PATCH] cmd_mmc: add support device command for selecting mmc device

Mike Frysinger vapier at gentoo.org
Sat Mar 28 11:15:06 CET 2009


On Saturday 28 March 2009 01:04:10 Minkyu Kang wrote:
> +	case 2:
> +		if (strncmp(argv[1], "init", 4) == 0) {
> +		} else if (strncmp(argv[1], "dev", 3) == 0) {

why strncmp ?  i dont think it makes sense to support "init", "init.moo" 
"initaksldfjaksldfjasdf" ...

> +				printf("No MMC card found\n");

no format modifiers -> use puts()

> +			if (curr_device < 0) {
> +				printf("no MMC devices available\n");

puts("No MMC card selected\n");

> +	case 3:

considering how much code is duplicated with "case 2", seems like it would 
make sense to unify them and have each piece check the argc

>  U_BOOT_CMD(
> -	mmcinit,	1,	0,	do_mmc,
> -	"init mmc card",
> -	NULL
> +	mmc,	3,	1,	do_mmc,
> +	"MMC sub-system",
> +	"mmc init [dev] - init MMC sub system\n"

first usage string should omit the command.  run 'help mmc' on the board to 
see why ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20090328/1504de03/attachment.pgp 


More information about the U-Boot mailing list