mtd: omap-nand: pass device_node in platform data
authorDaniel Mack <zonque@gmail.com>
Fri, 14 Dec 2012 10:36:41 +0000 (11:36 +0100)
committerTony Lindgren <tony@atomide.com>
Mon, 14 Jan 2013 17:55:19 +0000 (09:55 -0800)
Pass an optional device_node pointer in the platform data, which in turn
will be put into a mtd_part_parser_data. This way, code that sets up the
platform devices can pass along the node from DT so that the partitions
can be parsed.

For non-DT boards, this change has no effect.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Artem Bityutskiy <dedekind1@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mtd/nand/omap2.c
include/linux/platform_data/mtd-nand-omap2.h

index 0002d5e94f0d0e3b84f36d2ccb505c95a30b4cdb..1d333497cfcb22c5ce2fd13dc52802b21b56f3d4 100644 (file)
@@ -1332,6 +1332,7 @@ static int omap_nand_probe(struct platform_device *pdev)
        dma_cap_mask_t mask;
        unsigned sig;
        struct resource                 *res;
+       struct mtd_part_parser_data     ppdata = {};
 
        pdata = pdev->dev.platform_data;
        if (pdata == NULL) {
@@ -1557,7 +1558,8 @@ static int omap_nand_probe(struct platform_device *pdev)
                goto out_release_mem_region;
        }
 
-       mtd_device_parse_register(&info->mtd, NULL, NULL, pdata->parts,
+       ppdata.of_node = pdata->of_node;
+       mtd_device_parse_register(&info->mtd, NULL, &ppdata, pdata->parts,
                                  pdata->nr_parts);
 
        platform_set_drvdata(pdev, &info->mtd);
index 24d32ca34bef0724751e350fe90a48f7faa60281..6bf9ef43ddb1cfad1922e70e711c91aab5407af3 100644 (file)
@@ -60,6 +60,8 @@ struct omap_nand_platform_data {
        int                     devsize;
        enum omap_ecc           ecc_opt;
        struct gpmc_nand_regs   reg;
-};
 
+       /* for passing the partitions */
+       struct device_node      *of_node;
+};
 #endif