[U-Boot] [PATCH] MMC: add erase function to both mmc and sd

Mike Frysinger vapier at gentoo.org
Fri Jun 17 02:57:17 CEST 2011


On Thursday, June 16, 2011 09:47:56 Lei Wen wrote:
> +	} else if (strcmp(argv[1], "erase") == 0) {
> +		u32 cnt = simple_strtoul(argv[3], NULL, 16);
> +		u32 n;
> +		struct mmc *mmc = find_mmc_device(dev);
> +
> +		int blk = simple_strtoul(argv[2], NULL, 16);
> +
> +		if (!mmc) {
> +			printf("no mmc device at slot %x\n", curr_device);
> +			return 1;
> +		}
> +
> +		printf("\nMMC erase: dev # %d, block # %d, count %d ... ",
> +				curr_device, blk, cnt);
> +
> +		mmc_init(mmc);

this logic really needs to get cleaned up rather than every sub-mmc command 
doing the same thing over and over ...

> +	printf("mmc erase failed\n\r");

no output strings should include \r in them
-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/20110616/a51fe443/attachment.pgp 


More information about the U-Boot mailing list