aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/redboot.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-02-03 04:37:47 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:24:14 -0400
commit050c0c1bb2604a62bb250ff6181e9c00727da510 (patch)
treeb17ed0512819652b9fb9f6254e01c173b528d3fd /drivers/mtd/redboot.c
parentb25675722acf8a81638afb1124b38c4752299fa5 (diff)
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>
Diffstat (limited to 'drivers/mtd/redboot.c')
-rw-r--r--drivers/mtd/redboot.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c
index 48970c14beff..580035c803d6 100644
--- a/drivers/mtd/redboot.c
+++ b/drivers/mtd/redboot.c
@@ -78,8 +78,7 @@ static int parse_redboot_partitions(struct mtd_info *master,
78 78
79 if ( directory < 0 ) { 79 if ( directory < 0 ) {
80 offset = master->size + directory * master->erasesize; 80 offset = master->size + directory * master->erasesize;
81 while (mtd_can_have_bb(master) && 81 while (mtd_block_isbad(master, offset)) {
82 mtd_block_isbad(master, offset)) {
83 if (!offset) { 82 if (!offset) {
84 nogood: 83 nogood:
85 printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n"); 84 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,
89 } 88 }
90 } else { 89 } else {
91 offset = directory * master->erasesize; 90 offset = directory * master->erasesize;
92 while (mtd_can_have_bb(master) && 91 while (mtd_block_isbad(master, offset)) {
93 mtd_block_isbad(master, offset)) {
94 offset += master->erasesize; 92 offset += master->erasesize;
95 if (offset == master->size) 93 if (offset == master->size)
96 goto nogood; 94 goto nogood;