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 <[email protected]>
Reviewed-by: Brian Norris <[email protected]>
Tested-by: Brian Norris <[email protected]>
Reviewed-by: Richard Weinberger <[email protected]>
Signed-off-by: Boris Brezillon <[email protected]>
This commit is contained in:
Rafał Miłecki authored and Boris Brezillon committed 2018-03-27 09:11:31 +02:00
1 parent c0faf43482
commit 97b0c7c0df
1 file changed
+7
+7
View File
@@ -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,