0047-mtd-plat-nand-pass-of-node.patch 890 B

123456789101112131415161718192021222324252627
  1. --- a/drivers/mtd/nand/plat_nand.c
  2. +++ b/drivers/mtd/nand/plat_nand.c
  3. @@ -31,6 +31,7 @@ static int plat_nand_probe(struct platfo
  4. {
  5. struct platform_nand_data *pdata = dev_get_platdata(&pdev->dev);
  6. struct mtd_part_parser_data ppdata;
  7. + struct device_node *np = pdev->dev.of_node;
  8. struct plat_nand_data *data;
  9. struct resource *res;
  10. const char **part_types;
  11. @@ -58,6 +59,7 @@ static int plat_nand_probe(struct platfo
  12. return PTR_ERR(data->io_base);
  13. data->chip.priv = &data;
  14. + data->chip.flash_node = np;
  15. data->mtd.priv = &data->chip;
  16. data->mtd.dev.parent = &pdev->dev;
  17. @@ -105,7 +107,7 @@ static int plat_nand_probe(struct platfo
  18. part_types = pdata->chip.part_probe_types;
  19. - ppdata.of_node = pdev->dev.of_node;
  20. + ppdata.of_node = np;
  21. err = mtd_device_parse_register(&data->mtd, part_types, &ppdata,
  22. pdata->chip.partitions,
  23. pdata->chip.nr_partitions);