067-v4.17-0002-mtd-rename-ofpart-parser-to-fixed-partitions-as-it-f.patch 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From c0faf43482e7f7dfb6d61847cb93d17748560b24 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
  3. Date: Wed, 14 Mar 2018 13:10:43 +0100
  4. Subject: [PATCH] mtd: rename "ofpart" parser to "fixed-partitions" as it fits
  5. it better
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. Type "ofpart" means that OF should be used to get partitioning info and
  10. this driver supports "fixed-partitions" binding only. Renaming it should
  11. lead to less confusion especially when parsers for new compatibility
  12. strings start to appear.
  13. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
  14. Reviewed-by: Richard Weinberger <richard@nod.at>
  15. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
  16. ---
  17. drivers/mtd/mtdpart.c | 4 ++--
  18. drivers/mtd/ofpart.c | 11 ++++++-----
  19. 2 files changed, 8 insertions(+), 7 deletions(-)
  20. --- a/drivers/mtd/mtdpart.c
  21. +++ b/drivers/mtd/mtdpart.c
  22. @@ -932,7 +932,7 @@ static int mtd_part_of_parse(struct mtd_
  23. struct device_node *np;
  24. struct property *prop;
  25. const char *compat;
  26. - const char *fixed = "ofpart";
  27. + const char *fixed = "fixed-partitions";
  28. int ret, err = 0;
  29. np = of_get_child_by_name(mtd_get_of_node(master), "partitions");
  30. @@ -952,7 +952,7 @@ static int mtd_part_of_parse(struct mtd_
  31. of_node_put(np);
  32. /*
  33. - * For backward compatibility we have to try the "ofpart"
  34. + * For backward compatibility we have to try the "fixed-partitions"
  35. * parser. It supports old DT format with partitions specified as a
  36. * direct subnodes of a flash device DT node without any compatibility
  37. * specified we could match.
  38. --- a/drivers/mtd/ofpart.c
  39. +++ b/drivers/mtd/ofpart.c
  40. @@ -25,9 +25,9 @@ static bool node_has_compatible(struct d
  41. return of_get_property(pp, "compatible", NULL);
  42. }
  43. -static int parse_ofpart_partitions(struct mtd_info *master,
  44. - const struct mtd_partition **pparts,
  45. - struct mtd_part_parser_data *data)
  46. +static int parse_fixed_partitions(struct mtd_info *master,
  47. + const struct mtd_partition **pparts,
  48. + struct mtd_part_parser_data *data)
  49. {
  50. struct mtd_partition *parts;
  51. struct device_node *mtd_node;
  52. @@ -141,8 +141,8 @@ ofpart_none:
  53. }
  54. static struct mtd_part_parser ofpart_parser = {
  55. - .parse_fn = parse_ofpart_partitions,
  56. - .name = "ofpart",
  57. + .parse_fn = parse_fixed_partitions,
  58. + .name = "fixed-partitions",
  59. };
  60. static int parse_ofoldpart_partitions(struct mtd_info *master,
  61. @@ -230,4 +230,5 @@ MODULE_AUTHOR("Vitaly Wool, David Gibson
  62. * with the same name. Since we provide the ofoldpart parser, we should have
  63. * the corresponding alias.
  64. */
  65. +MODULE_ALIAS("fixed-partitions");
  66. MODULE_ALIAS("ofoldpart");