summaryrefslogtreecommitdiffstats
path: root/target/linux/gemini/patches/100-mtd-physmap-try-static-partitions-first.patch
blob: 2c085e1ce20e2b931dbece985fe8542fad0285a5 (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
25
26
27
28
29
30
--- a/drivers/mtd/maps/physmap.c
+++ b/drivers/mtd/maps/physmap.c
@@ -173,6 +173,13 @@ static int physmap_flash_probe(struct pl
 		goto err_out;
 
 #ifdef CONFIG_MTD_PARTITIONS
+	if (physmap_data->nr_parts) {
+		printk(KERN_NOTICE "Using physmap partition information\n");
+		add_mtd_partitions(info->cmtd, physmap_data->parts,
+				   physmap_data->nr_parts);
+		return 0;
+	}
+
 	err = parse_mtd_partitions(info->cmtd, part_probe_types,
 				&info->parts, 0);
 	if (err > 0) {
@@ -180,13 +187,6 @@ static int physmap_flash_probe(struct pl
 		info->nr_parts = err;
 		return 0;
 	}
-
-	if (physmap_data->nr_parts) {
-		printk(KERN_NOTICE "Using physmap partition information\n");
-		add_mtd_partitions(info->cmtd, physmap_data->parts,
-				   physmap_data->nr_parts);
-		return 0;
-	}
 #endif
 
 	add_mtd_device(info->cmtd);