mtd: redboot: remove useless code
We do not need to invoke 'mtd_can_have_bb()' before invoking 'mtd_block_isbad()' because the latter already handles the case when the MTD device does not support bad blocks. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
b25675722a
commit
050c0c1bb2
|
@ -78,8 +78,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
|
||||||
|
|
||||||
if ( directory < 0 ) {
|
if ( directory < 0 ) {
|
||||||
offset = master->size + directory * master->erasesize;
|
offset = master->size + directory * master->erasesize;
|
||||||
while (mtd_can_have_bb(master) &&
|
while (mtd_block_isbad(master, offset)) {
|
||||||
mtd_block_isbad(master, offset)) {
|
|
||||||
if (!offset) {
|
if (!offset) {
|
||||||
nogood:
|
nogood:
|
||||||
printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n");
|
printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n");
|
||||||
|
@ -89,8 +88,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
offset = directory * master->erasesize;
|
offset = directory * master->erasesize;
|
||||||
while (mtd_can_have_bb(master) &&
|
while (mtd_block_isbad(master, offset)) {
|
||||||
mtd_block_isbad(master, offset)) {
|
|
||||||
offset += master->erasesize;
|
offset += master->erasesize;
|
||||||
if (offset == master->size)
|
if (offset == master->size)
|
||||||
goto nogood;
|
goto nogood;
|
||||||
|
|
Loading…
Reference in New Issue