Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[pandora-kernel.git] / drivers / mtd / devices / mtd_dataflash.c
index 6d9f810..62dee54 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
-
 /* ......................................................................... */
 
 /*
@@ -670,6 +664,8 @@ add_dataflash_otp(struct spi_device *spi, char *name,
        device->write = dataflash_write;
        device->priv = priv;
 
+       device->dev.parent = &spi->dev;
+
        if (revision >= 'c')
                otp_tag = otp_setup(device, revision);
 
@@ -682,11 +678,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;