Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc75eb36 authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by Tony Lindgren
Browse files

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: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 6797b4fe
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -637,6 +637,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
	struct onenand_chip *this;
	struct onenand_chip *this;
	int r;
	int r;
	struct resource *res;
	struct resource *res;
	struct mtd_part_parser_data ppdata = {};


	pdata = pdev->dev.platform_data;
	pdata = pdev->dev.platform_data;
	if (pdata == NULL) {
	if (pdata == NULL) {
@@ -767,7 +768,8 @@ static int omap2_onenand_probe(struct platform_device *pdev)
	if ((r = onenand_scan(&c->mtd, 1)) < 0)
	if ((r = onenand_scan(&c->mtd, 1)) < 0)
		goto err_release_regulator;
		goto err_release_regulator;


	r = mtd_device_parse_register(&c->mtd, NULL, NULL,
	ppdata.of_node = pdata->of_node;
	r = mtd_device_parse_register(&c->mtd, NULL, &ppdata,
				      pdata ? pdata->parts : NULL,
				      pdata ? pdata->parts : NULL,
				      pdata ? pdata->nr_parts : 0);
				      pdata ? pdata->nr_parts : 0);
	if (r)
	if (r)
+3 −0
Original line number Original line Diff line number Diff line
@@ -29,5 +29,8 @@ struct omap_onenand_platform_data {
	u8			flags;
	u8			flags;
	u8			regulator_can_sleep;
	u8			regulator_can_sleep;
	u8			skip_initial_unlocking;
	u8			skip_initial_unlocking;

	/* for passing the partitions */
	struct device_node	*of_node;
};
};
#endif
#endif