mtd: nand: drop unnecessary partition parser data

All of these drivers set up a parser data struct just to communicate DT
partition data. This field has been deprecated and is instead supported
by telling nand_scan_ident() about the 'flash_node'.

This patch:
 * sets chip->flash_node for those drivers that didn't already (but used
   OF partitioning)
 * drops the parser data
 * switches to the simpler mtd_device_register() where possible, now
   that we've eliminated one of the auxiliary parameters

Now that we've assigned chip->flash_node for these drivers, we can
probably rely on nand_dt_init() to do more of the DT parsing for us, but
for now, I don't want to fiddle with each of these drivers. The parsing
is done in duplicate for now on some drivers. I don't think this should
break things. (Famous last words.)

(Rolled in some changes by Boris Brezillon)

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
This commit is contained in:
Brian Norris
2015-10-30 20:33:25 -07:00
parent 9c7d787508
commit a61ae81a19
24 changed files with 54 additions and 88 deletions

View File

@@ -30,7 +30,6 @@ struct plat_nand_data {
static int plat_nand_probe(struct platform_device *pdev)
{
struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev);
struct mtd_part_parser_data ppdata;
struct plat_nand_data *data;
struct resource *res;
const char **part_types;
@@ -58,6 +57,7 @@ static int plat_nand_probe(struct platform_device *pdev)
return PTR_ERR(data->io_base);
data->chip.priv = &data;
nand_set_flash_node(&data->chip, pdev->dev.of_node);
data->mtd.priv = &data->chip;
data->mtd.dev.parent = &pdev->dev;
@@ -94,8 +94,7 @@ static int plat_nand_probe(struct platform_device *pdev)
part_types = pdata->chip.part_probe_types;
ppdata.of_node = pdev->dev.of_node;
err = mtd_device_parse_register(&data->mtd, part_types, &ppdata,
err = mtd_device_parse_register(&data->mtd, part_types, NULL,
pdata->chip.partitions,
pdata->chip.nr_partitions);