mxc_nand: add support for platform defined partitions
authorBaruch Siach <baruch@tkos.co.il>
Mon, 31 May 2010 05:49:40 +0000 (08:49 +0300)
committerSascha Hauer <s.hauer@pengutronix.de>
Mon, 26 Jul 2010 12:17:53 +0000 (14:17 +0200)
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/plat-mxc/include/mach/mxc_nand.h
drivers/mtd/nand/mxc_nand.c

index 5d2d21d414e0e71716ab8878a14548010faff253..2d74748c5db73e38ce2e3ee7e81267ded6f63f92 100644 (file)
 #ifndef __ASM_ARCH_NAND_H
 #define __ASM_ARCH_NAND_H
 
+#include <linux/mtd/partitions.h>
+
 struct mxc_nand_platform_data {
        int width;      /* data bus width in bytes */
        int hw_ecc:1;   /* 0 if supress hardware ECC */
        int flash_bbt:1; /* set to 1 to use a flash based bbt */
+       struct mtd_partition *parts;    /* partition table */
+       int nr_parts;                   /* size of parts */
 };
 #endif /* __ASM_ARCH_NAND_H */
index 6e8aa34e4dfc34919bac727cd6028cb500746e11..0d76b169482f47afff1bbb4f09696c771e3f829e 100644 (file)
@@ -832,6 +832,8 @@ static int __init mxcnd_probe(struct platform_device *pdev)
            parse_mtd_partitions(mtd, part_probes, &host->parts, 0);
        if (nr_parts > 0)
                add_mtd_partitions(mtd, host->parts, nr_parts);
+       else if (pdata->parts)
+               add_mtd_partitions(mtd, pdata->parts, pdata->nr_parts);
        else
 #endif
        {