提交 97b0c7c0 编写于 作者: R Rafał Miłecki 提交者: Boris Brezillon

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: NRafał Miłecki <rafal@milecki.pl>
Reviewed-by: NBrian Norris <computersforpeace@gmail.com>
Tested-by: NBrian Norris <computersforpeace@gmail.com>
Reviewed-by: NRichard Weinberger <richard@nod.at>
Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com>
上级 c0faf434
...@@ -140,9 +140,16 @@ static int parse_fixed_partitions(struct mtd_info *master, ...@@ -140,9 +140,16 @@ static int parse_fixed_partitions(struct mtd_info *master,
return ret; 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 = { static struct mtd_part_parser ofpart_parser = {
.parse_fn = parse_fixed_partitions, .parse_fn = parse_fixed_partitions,
.name = "fixed-partitions", .name = "fixed-partitions",
.of_match_table = parse_ofpart_match_table,
}; };
static int parse_ofoldpart_partitions(struct mtd_info *master, static int parse_ofoldpart_partitions(struct mtd_info *master,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册