From: Rafał Miłecki Date: Wed, 14 Mar 2018 12:10:44 +0000 (+0100) Subject: mtd: ofpart: add of_match_table with "fixed-partitions" X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=97b0c7c0df3efd7048ed39d7e2dee34cafd55887;p=linux.git 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 Reviewed-by: Brian Norris Tested-by: Brian Norris Reviewed-by: Richard Weinberger Signed-off-by: Boris Brezillon --- diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index 9f497315e65d4..615f8c173162c 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,