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

Lei Wen adrian.wenl at gmail.com
Fri Jun 17 05:09:40 CEST 2011


Hi Mike,

On Fri, Jun 17, 2011 at 8:57 AM, Mike Frysinger <vapier at gentoo.org> wrote:
> 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 ...

Agree, I would sort it out as a seperate patch.

>
>> +     printf("mmc erase failed\n\r");
>
> no output strings should include \r in them

Opps... I would correct that.

Thanks,
Lei


More information about the U-Boot mailing list