Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ezequiel Garcia and committed by
Tony Lindgren
dc75eb36 6797b4fe

+6 -1
+3 -1
drivers/mtd/onenand/omap2.c
··· 637 637 struct onenand_chip *this; 638 638 int r; 639 639 struct resource *res; 640 + struct mtd_part_parser_data ppdata = {}; 640 641 641 642 pdata = pdev->dev.platform_data; 642 643 if (pdata == NULL) { ··· 768 767 if ((r = onenand_scan(&c->mtd, 1)) < 0) 769 768 goto err_release_regulator; 770 769 771 - r = mtd_device_parse_register(&c->mtd, NULL, NULL, 770 + ppdata.of_node = pdata->of_node; 771 + r = mtd_device_parse_register(&c->mtd, NULL, &ppdata, 772 772 pdata ? pdata->parts : NULL, 773 773 pdata ? pdata->nr_parts : 0); 774 774 if (r)
+3
include/linux/platform_data/mtd-onenand-omap2.h
··· 29 29 u8 flags; 30 30 u8 regulator_can_sleep; 31 31 u8 skip_initial_unlocking; 32 + 33 + /* for passing the partitions */ 34 + struct device_node *of_node; 32 35 }; 33 36 #endif