From: Mike Frysinger Date: Thu, 16 Jun 2011 20:57:17 -0400 Subject: [U-Boot] [PATCH] MMC: add erase function to both mmc and sd In-Reply-To: <1308232076-20116-1-git-send-email-leiwen@marvell.com> References: <1308232076-20116-1-git-send-email-leiwen@marvell.com> Message-ID: <201106162057.18965.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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