diff options
author | Ezequiel Garcia <ezequiel.garcia@free-electrons.com> | 2013-01-25 07:23:09 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2013-02-01 17:10:11 -0500 |
commit | dc75eb36c3233409728e88acfd6b45a223856289 (patch) | |
tree | ab791a0aad245e940231c2223d7417620cf227c4 /drivers/mtd | |
parent | 6797b4fe0e554ce71f47038fd929c9ca929a9f3c (diff) |
mtd: omap-onenand: pass device_node in platform data
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.
Acked-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/onenand/omap2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/onenand/omap2.c b/drivers/mtd/onenand/omap2.c index 065f3fe02a2f..eec2aedb4ab8 100644 --- a/drivers/mtd/onenand/omap2.c +++ b/drivers/mtd/onenand/omap2.c | |||
@@ -637,6 +637,7 @@ static int omap2_onenand_probe(struct platform_device *pdev) | |||
637 | struct onenand_chip *this; | 637 | struct onenand_chip *this; |
638 | int r; | 638 | int r; |
639 | struct resource *res; | 639 | struct resource *res; |
640 | struct mtd_part_parser_data ppdata = {}; | ||
640 | 641 | ||
641 | pdata = pdev->dev.platform_data; | 642 | pdata = pdev->dev.platform_data; |
642 | if (pdata == NULL) { | 643 | if (pdata == NULL) { |
@@ -767,7 +768,8 @@ static int omap2_onenand_probe(struct platform_device *pdev) | |||
767 | if ((r = onenand_scan(&c->mtd, 1)) < 0) | 768 | if ((r = onenand_scan(&c->mtd, 1)) < 0) |
768 | goto err_release_regulator; | 769 | goto err_release_regulator; |
769 | 770 | ||
770 | r = mtd_device_parse_register(&c->mtd, NULL, NULL, | 771 | ppdata.of_node = pdata->of_node; |
772 | r = mtd_device_parse_register(&c->mtd, NULL, &ppdata, | ||
771 | pdata ? pdata->parts : NULL, | 773 | pdata ? pdata->parts : NULL, |
772 | pdata ? pdata->nr_parts : 0); | 774 | pdata ? pdata->nr_parts : 0); |
773 | if (r) | 775 | if (r) |