Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84188
b: refs/heads/master
c: 3c441ba
h: refs/heads/master
v: v3
  • Loading branch information
David Woodhouse committed Oct 29, 2007
1 parent a8f1bb4 commit a0997d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c37f3329ae098d4c17e8bec589a589bcbf0acff
refs/heads/master: 3c441baa0365ea7c3be9ee79f03e944289dd37e1
25 changes: 20 additions & 5 deletions trunk/drivers/mtd/redboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,31 @@ static int parse_redboot_partitions(struct mtd_info *master,
static char nullstring[] = "unallocated";
#endif

if ( directory < 0 ) {
offset = master->size + directory * master->erasesize;
while (master->block_isbad &&
master->block_isbad(master, offset)) {
if (!offset) {
nogood:
printk(KERN_NOTICE "Failed to find a non-bad block to check for RedBoot partition table\n");
return -EIO;
}
offset -= master->erasesize;
}
} else {
offset = directory * master->erasesize;
while (master->block_isbad &&
master->block_isbad(master, offset)) {
offset += master->erasesize;
if (offset == master->size)
goto nogood;
}
}
buf = vmalloc(master->erasesize);

if (!buf)
return -ENOMEM;

if ( directory < 0 )
offset = master->size + directory*master->erasesize;
else
offset = directory*master->erasesize;

printk(KERN_NOTICE "Searching for RedBoot partition table in %s at offset 0x%lx\n",
master->name, offset);

Expand Down

0 comments on commit a0997d6

Please sign in to comment.