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