nanddump: skip bad blocks when instructed to do so

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Baruch Siach 2012-10-15 14:25:26 +02:00 committed by Denys Vlasenko
parent da0200a1e5
commit 98f6b2d399

View File

@ -182,7 +182,7 @@ int nandwrite_main(int argc UNUSED_PARAM, char **argv)
mtdoffset = next_good_eraseblock(fd, &meminfo, blockstart); mtdoffset = next_good_eraseblock(fd, &meminfo, blockstart);
if (IS_NANDWRITE) if (IS_NANDWRITE)
printf("Writing at 0x%08x\n", mtdoffset); printf("Writing at 0x%08x\n", mtdoffset);
else if (mtdoffset > blockstart) { else if (mtdoffset > blockstart && !(opts & OPT_b)) {
int bad_len = MIN(mtdoffset, limit) - blockstart; int bad_len = MIN(mtdoffset, limit) - blockstart;
dump_bad(&meminfo, bad_len, !(opts & OPT_o)); dump_bad(&meminfo, bad_len, !(opts & OPT_o));
} }