Skip to contentSkip to conversation

physmap: probe for partitions parsers that we enable

PATCH In review Florian Fainelli 2 participants 2 messages Jul 15, 2009 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 physmap: probe for partitions parsers that we enable

This patch makes the physmap driver probe for partitions parsers that we configured in the kernel configuration instead of a hard-coded partition parser list (cmdlinepart, RedBoot).

---

drivers/mtd/maps/physmap.c +11 -1
index 29a9011..e314f0d 100644
@@ -80,7 +80,17 @@ static const char *rom_probe_types[] = {
 					"map_rom",
 					NULL };
 #ifdef CONFIG_MTD_PARTITIONS
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
+static const char *part_probe_types[] = {
+#ifdef CONFIG_MTD_CMDLINE_PARTS
+	"cmdlinepart",
+#endif
+#ifdef CONFIG_MTD_REDBOOT_PARTS
+	"RedBoot",
+#endif
+#ifdef CONFIG_MTD_AR7_PARTS
+	"ar7part",
+#endif
+	NULL };
 #endif
 
 static int physmap_flash_probe(struct platform_device *dev)
#1 lore raw
Quoted 4 lines · Florian Fainelli

This patch makes the physmap driver probe for partitions parsers that we configured in the kernel configuration instead of a hard-coded partition parser list (cmdlinepart, RedBoot).

i believe there was a thread on this list some time ago about how forcing all maps to declare support partition types sucks. be nice if there was a mtd function to probe all available maps so we wouldnt have to copy & paste this #ifdef mess everywhere.

Quoted 9 lines
drivers/mtd/maps/physmap.c +2 -1
@@ -80,7 +80,17 @@ static const char *rom_probe_types[] = {
                                        "map_rom",
                                        NULL };
  #ifdef CONFIG_MTD_PARTITIONS
-static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL };
+static const char *part_probe_types[] = {
+#ifdef CONFIG_MTD_CMDLINE_PARTS

drivers/mtd/maps/physmap.c static const char *rom_probe_types[] = { · line 94

Quoted 10 lines
drivers/mtd/maps/physmap.c +9 -0
+       "cmdlinepart",
+#endif
+#ifdef CONFIG_MTD_REDBOOT_PARTS
+       "RedBoot",
+#endif
+#ifdef CONFIG_MTD_AR7_PARTS
+       "ar7part",
+#endif
+       NULL };
  #endif

me thinks you just broke support when redboot is a module. cmdlinepart isnt allowed to be a module via Kconfig, but ar7 can be. -mike