[MTD] partitioning utility predicates
[pandora-kernel.git] / drivers / mtd / devices / mtd_dataflash.c
index 6d9f810..d95f74a 100644 (file)
@@ -98,12 +98,6 @@ struct dataflash {
        struct mtd_info         mtd;
 };
 
-#ifdef CONFIG_MTD_PARTITIONS
-#define        mtd_has_partitions()    (1)
-#else
-#define        mtd_has_partitions()    (0)
-#endif
-
 /* ......................................................................... */
 
 /*
@@ -682,11 +676,13 @@ add_dataflash_otp(struct spi_device *spi, char *name,
                struct mtd_partition    *parts;
                int                     nr_parts = 0;
 
-#ifdef CONFIG_MTD_CMDLINE_PARTS
-               static const char *part_probes[] = { "cmdlinepart", NULL, };
+               if (mtd_has_cmdlinepart()) {
+                       static const char *part_probes[]
+                                       = { "cmdlinepart", NULL, };
 
-               nr_parts = parse_mtd_partitions(device, part_probes, &parts, 0);
-#endif
+                       nr_parts = parse_mtd_partitions(device,
+                                       part_probes, &parts, 0);
+               }
 
                if (nr_parts <= 0 && pdata && pdata->parts) {
                        parts = pdata->parts;