mtd: drop unnecessary partition parser data
We should assign the MTD dev.of_node instead of the parser data field. This gets us the equivalent partition parser behavior with fewer special fields and parameter passing. Also convert several of these to mtd_device_register(), since we don't need the 2nd and 3rd parameters anymore. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
This commit is contained in:
@@ -614,7 +614,6 @@ static int omap2_onenand_probe(struct platform_device *pdev)
|
||||
struct onenand_chip *this;
|
||||
int r;
|
||||
struct resource *res;
|
||||
struct mtd_part_parser_data ppdata = {};
|
||||
|
||||
pdata = dev_get_platdata(&pdev->dev);
|
||||
if (pdata == NULL) {
|
||||
@@ -713,6 +712,7 @@ static int omap2_onenand_probe(struct platform_device *pdev)
|
||||
c->mtd.priv = &c->onenand;
|
||||
|
||||
c->mtd.dev.parent = &pdev->dev;
|
||||
mtd_set_of_node(&c->mtd, pdata->of_node);
|
||||
|
||||
this = &c->onenand;
|
||||
if (c->dma_channel >= 0) {
|
||||
@@ -743,10 +743,8 @@ static int omap2_onenand_probe(struct platform_device *pdev)
|
||||
if ((r = onenand_scan(&c->mtd, 1)) < 0)
|
||||
goto err_release_regulator;
|
||||
|
||||
ppdata.of_node = pdata->of_node;
|
||||
r = mtd_device_parse_register(&c->mtd, NULL, &ppdata,
|
||||
pdata ? pdata->parts : NULL,
|
||||
pdata ? pdata->nr_parts : 0);
|
||||
r = mtd_device_register(&c->mtd, pdata ? pdata->parts : NULL,
|
||||
pdata ? pdata->nr_parts : 0);
|
||||
if (r)
|
||||
goto err_release_onenand;
|
||||
|
||||
|
Reference in New Issue
Block a user