1
0

044-v4.18-mtd-bcm47xxpart-add-of_match_table-with-a-new-DT-bin.patch 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. From cf589ce71e84d3b8811c65740645af254c5248c0 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  3. Date: Wed, 9 May 2018 10:17:29 +0200
  4. Subject: [PATCH] mtd: bcm47xxpart: add of_match_table with a new DT binding
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This allows using bcm47xxpart parser to find partitions on flash
  9. described in DT using the "brcm,bcm947xx-cfe-partitions" compatible
  10. property. It means this parser doesn't have to be explicitly selected by
  11. a flash driver anymore. It can be used e.g. together with a generic
  12. m25p80 / spi-nor if device is just properly described.
  13. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  14. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
  15. ---
  16. drivers/mtd/bcm47xxpart.c | 7 +++++++
  17. 1 file changed, 7 insertions(+)
  18. --- a/drivers/mtd/bcm47xxpart.c
  19. +++ b/drivers/mtd/bcm47xxpart.c
  20. @@ -304,9 +304,16 @@ static int bcm47xxpart_parse(struct mtd_
  21. return curr_part;
  22. };
  23. +static const struct of_device_id bcm47xxpart_of_match_table[] = {
  24. + { .compatible = "brcm,bcm947xx-cfe-partitions" },
  25. + {},
  26. +};
  27. +MODULE_DEVICE_TABLE(of, bcm47xxpart_of_match_table);
  28. +
  29. static struct mtd_part_parser bcm47xxpart_mtd_parser = {
  30. .parse_fn = bcm47xxpart_parse,
  31. .name = "bcm47xxpart",
  32. + .of_match_table = bcm47xxpart_of_match_table,
  33. };
  34. module_mtd_part_parser(bcm47xxpart_mtd_parser);