mtd: redboot: remove useless code
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 3 Feb 2012 09:37:47 +0000 (11:37 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:24:14 +0000 (00:24 +0100)
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>
drivers/mtd/redboot.c

index 48970c1..580035c 100644 (file)
@@ -78,8 +78,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
 
        if ( directory < 0 ) {
                offset = master->size + directory * master->erasesize;
-               while (mtd_can_have_bb(master) &&
-                      mtd_block_isbad(master, offset)) {
+               while (mtd_block_isbad(master, offset)) {
                        if (!offset) {
                        nogood:
                                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 {
                offset = directory * master->erasesize;
-               while (mtd_can_have_bb(master) &&
-                      mtd_block_isbad(master, offset)) {
+               while (mtd_block_isbad(master, offset)) {
                        offset += master->erasesize;
                        if (offset == master->size)
                                goto nogood;