summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ofpart.c
diff options
context:
space:
mode:
authorRafał Miłecki2018-03-14 13:10:44 +0100
committerBoris Brezillon2018-03-27 09:11:31 +0200
commit97b0c7c0df3efd7048ed39d7e2dee34cafd55887 (patch)
tree82ca6daef7761282c5908f2c6095b5a250c9e7a7 /drivers/mtd/ofpart.c
parentmtd: rename "ofpart" parser to "fixed-partitions" as it fits it better (diff)
downloadkernel-qcow2-linux-97b0c7c0df3efd7048ed39d7e2dee34cafd55887.tar.gz
kernel-qcow2-linux-97b0c7c0df3efd7048ed39d7e2dee34cafd55887.tar.xz
kernel-qcow2-linux-97b0c7c0df3efd7048ed39d7e2dee34cafd55887.zip
mtd: ofpart: add of_match_table with "fixed-partitions"
This allows using this parser with any flash driver that takes care of setting of_node (using mtd_set_of_node helper) correctly. Up to now support for "fixed-partitions" DT compatibility string was working only with flash drivers that were specifying "ofpart" (manually or by letting mtd use the default set of parsers). This matches existing bindings documentation. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Reviewed-by: Brian Norris <computersforpeace@gmail.com> Tested-by: Brian Norris <computersforpeace@gmail.com> Reviewed-by: Richard Weinberger <richard@nod.at> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/mtd/ofpart.c')
-rw-r--r--drivers/mtd/ofpart.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index 9f497315e65d..615f8c173162 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -140,9 +140,16 @@ ofpart_none:
return ret;
}
+static const struct of_device_id parse_ofpart_match_table[] = {
+ { .compatible = "fixed-partitions" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, parse_ofpart_match_table);
+
static struct mtd_part_parser ofpart_parser = {
.parse_fn = parse_fixed_partitions,
.name = "fixed-partitions",
+ .of_match_table = parse_ofpart_match_table,
};
static int parse_ofoldpart_partitions(struct mtd_info *master,