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