71a60cb20ea3ad4109132247c5903fdcb032840f
[openwrt/staging/florian.git] / target / linux / atheros / patches-2.6.24 / 140-redboot_partition_scan.patch
1 Index: linux-2.6.24.7/drivers/mtd/redboot.c
2 ===================================================================
3 --- linux-2.6.24.7.orig/drivers/mtd/redboot.c
4 +++ linux-2.6.24.7/drivers/mtd/redboot.c
5 @@ -64,6 +64,7 @@ static int parse_redboot_partitions(stru
6 if (!buf)
7 return -ENOMEM;
8
9 +restart:
10 if ( directory < 0 )
11 offset = master->size + directory*master->erasesize;
12 else
13 @@ -140,6 +141,11 @@ static int parse_redboot_partitions(stru
14 }
15 if (i == numslots) {
16 /* Didn't find it */
17 + if (offset + master->erasesize < master->size) {
18 + /* not at the end of the flash yet, maybe next block :) */
19 + directory++;
20 + goto restart;
21 + }
22 printk(KERN_NOTICE "No RedBoot partition table detected in %s\n",
23 master->name);
24 ret = 0;